#include "mainwindow.h"
#include <QApplication>
#include <QGuiApplication>
#include <QOffscreenSurface>
#include <QOpenGLFunctions>
#include <QOpenGLFramebufferObject>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <QOpenGLVertexArrayObject>
#include <QDebug>
#include <QImage>
#include <QLoggingCategory>


#include <QOpenGLTexture>

//QImage loadTexture2(char *filename, GLuint &textureID){
//    glEnable(GL_TEXTURE_2D); // Enable texturing

//    glGenTextures(1, &textureID); // Obtain an id for the texture
//    glBindTexture(GL_TEXTURE_2D, textureID); // Set as the current texture

//    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
//    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);

//    QImage im(filename);
//    QImage tex = QGLWidget::convertToGLFormat(im);

//    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.width(), tex.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, tex.bits());

//    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
//    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);

//    glDisable(GL_TEXTURE_2D);

//    return tex;
//}






struct Vertex3D
{
    int x,y,z;
};
 typedef Vertex3D BezierSurfaceBMatrix[4][4];

BezierSurfaceBMatrix B_;

void init_corner_anchors(QVector<QPoint> &corners , QVector<QPoint>& anchors, QImage &img){


    int width = img.width();
    int height = img.height();




    B_[0][0] ={0 ,          0 , 0};
    B_[1][0] ={width / 3    ,0 , 0};
    B_[2][0] ={width * 2 / 3 ,    0 , 0};
    B_[3][0] ={width  ,0 , 0};

    B_[0][1] ={0 ,                  height / 3 , 0};
    B_[1][1] ={width   ,         height / 3 , 0};
    B_[2][1] ={width  * 2/  3 ,     height / 3 , 0};
    B_[3][1] ={width ,              height / 3 , 0};


    B_[0][2] ={0 ,                  height * 2 / 3 , 0};
    B_[1][2] ={width / 3 ,          height * 2 / 3 , 0};
    B_[2][2] ={width * 2 / 3 ,      height * 2 / 3 , 0};
    B_[3][2] ={width  ,             height * 2 / 3 , 0};

    B_[0][3] ={0 ,                  height , 0};
    B_[1][3] ={width / 3 ,          height , 0};
    B_[2][3] ={width * 2 / 3 ,      height , 0};
    B_[3][3] ={width  ,             height , 0};



}



Vertex3D bezier(double u, double v)
{
    double u2 = u * u;
    double u3 = u2 * u;
    double v2 = v * v;
    double v3 = v2 * v;

    double U[4] = {1, u, u2, u3};
    double V[4] = {1, v, v2, v3};

    static const double M[4][4] = {
                       { 1, 0, 0, 0},
                       {-3, 3, 0, 0},
                       { 3,-6, 3, 0},
                       {-1, 3,-3, 1},
                       };
    //UM
    double UM[4] = {0};
    for (int i=0; i<4; i++)
       for (int j=0; j<4; j++)
           UM[i] += U[j]*M[j][i];

    //UMB
    double UMBx[4] = {0};
    double UMBy[4] = {0};
    double UMBz[4] = {0};
    for (int i=0; i<4; i++)
       for (int j=0; j<4; j++)
       {
           UMBx[i] += UM[j] * B_[j][i].x;
           UMBy[i] += UM[j] * B_[j][i].y;
           UMBz[i] += UM[j] * B_[j][i].z;
       }

    //UMB(M^T)
    double UMBMtx[4] = {0};
    double UMBMty[4] = {0};
    double UMBMtz[4] = {0};
    for (int i=0; i<4; i++)
       for (int j=0; j<4; j++)
       {
           UMBMtx[i] += UMBx[j] * M[i][j];
           UMBMty[i] += UMBy[j] * M[i][j];
           UMBMtz[i] += UMBz[j] * M[i][j];
       }

    //UMB(M^T)V
   Vertex3D res = {0,0,0};
    for (int i=0; i<4; i++)
    {
       res.x += UMBMtx[i] * V[i];
       res.y += UMBMty[i] * V[i];
       res.z += UMBMtz[i] * V[i];
    }

    return res;
}



int coodinate(){



        QSurfaceFormat surfaceFormat;
        surfaceFormat.setMajorVersion(4);
        surfaceFormat.setMinorVersion(3);

        QOpenGLContext openGLContext;
        openGLContext.setFormat(surfaceFormat);
        openGLContext.create();
        if (!openGLContext.isValid())
            qDebug("Unable to create context");

        QOffscreenSurface surface;
        surface.setFormat(surfaceFormat);
        surface.create();
        if (!surface.isValid())
            qDebug("Unable to create the Offscreen surface");

        openGLContext.makeCurrent(&surface);

        // Viewport size
        QSize vpSize = QSize(300, 300);

        QOpenGLFramebufferObjectFormat fboFormat;
        fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
        QOpenGLFramebufferObject fbo(vpSize, fboFormat);
        openGLContext.functions()->glViewport(0, 0, vpSize.width(), vpSize.height());




        QImage img("d://temp//people.png");

        // Generate a texture ID
        GLuint textureID;
        openGLContext.functions()->glGenTextures(1, &textureID);

        // Bind the texture
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);

        // Set texture parameters (adjust as needed)
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

        // Load the image data into the texture
        openGLContext.functions()->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.width(), img.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());

        // Unbind the texture
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, 0);



        fbo.bind();

        // Shaders
        QOpenGLShaderProgram program;
        program.addShaderFromSourceCode(QOpenGLShader::Vertex,
                                        "attribute vec2 position;\n"
                                        "attribute vec2 texCoord;\n"
                                        "varying vec2 v_texCoord;\n"
                                        "void main() {\n"
                                        "    gl_Position = vec4(position, 0.0, 1.0);\n"
                                        "    v_texCoord = texCoord;\n"
                                        "}");
        program.addShaderFromSourceCode(QOpenGLShader::Fragment,
                                        "uniform sampler2D textureSampler;\n"
                                        "varying vec2 v_texCoord;\n"
                                        "void main() {\n"
                                        "    gl_FragColor = texture2D(textureSampler, v_texCoord);\n"
                                        "}");
        program.link();
        program.bind();

        // Vertex buffer object (VBO) for points and texture coordinates
        static const float vertexPositions[] = {
            -0.5f, -0.5f, // Point 1
            0.5f, -0.5f,  // Point 2
            0.0f, 0.5f,   // Point 3
        };

        static const float textureCoordinates[] = {
            0.0f, 0.0f, // Texture coordinate for Point 1
            1.0f, 0.0f, // Texture coordinate for Point 2
            0.5f, 1.0f, // Texture coordinate for Point 3
        };

        QOpenGLBuffer vbo(QOpenGLBuffer::VertexBuffer);
        vbo.create();
        vbo.bind();
        vbo.allocate(vertexPositions, sizeof(vertexPositions) + sizeof(textureCoordinates));
        vbo.write(sizeof(vertexPositions), textureCoordinates, sizeof(textureCoordinates));

        // Set up attribute pointers
        program.enableAttributeArray("position");
        program.setAttributeBuffer("position", GL_FLOAT, 0, 2, 0);

        program.enableAttributeArray("texCoord");
        program.setAttributeBuffer("texCoord", GL_FLOAT, sizeof(vertexPositions), 2, 0);




















        // Set up texture
       // GLuint textureID; // Replace this with your actual texture ID
        openGLContext.functions()->glActiveTexture(GL_TEXTURE0);
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);
        program.setUniformValue("textureSampler", 0);

        // Clear the FBO and draw the points with textures
//        openGLContext.functions()->glClearColor(0.3f, 0.0f, 0.7f, 1.0f);
//        openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//        openGLContext.functions()->glDrawArrays(GL_POINTS, 0, 3);

        // Save the content of the FBO as an image
        QImage im = fbo.toImage();
        if (im.save("d://temp//asd.png"))
        {
            qDebug("Image saved!!");
        }
        return 1;

}

void trigle2(){


    QSurfaceFormat surfaceFormat;
    surfaceFormat.setMajorVersion(4);
    surfaceFormat.setMinorVersion(3);

    QOpenGLContext openGLContext;
    openGLContext.setFormat(surfaceFormat);
    openGLContext.create();
    if(!openGLContext.isValid()) qDebug("Unable to create context");

    QOffscreenSurface surface;
    surface.setFormat(surfaceFormat);
    surface.create();
    if(!surface.isValid()) qDebug("Unable to create the Offscreen surface");

    openGLContext.makeCurrent(&surface);

//   Viewport size
    QSize vpSize = QSize(300, 300);

    QOpenGLFramebufferObjectFormat fboFormat;
    fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
    QOpenGLFramebufferObject fbo(vpSize, fboFormat);
    openGLContext.functions()->glViewport(0,0,vpSize.width(), vpSize.height());
    
    
    
    
        QImage img("d://temp//300.png");

        // Generate a texture ID
        GLuint textureID;
        openGLContext.functions()->glGenTextures(1, &textureID);

        // Bind the texture
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);

        // Set texture parameters (adjust as needed)
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

        // Load the image data into the texture
        openGLContext.functions()->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.width(), img.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());

        // Unbind the texture
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, 0);
    
    
    fbo.bind();

//    ========GEOMEETRY SETUP========

    static const float vertexPositions[] = {
        -1.0f, -1.0f,
        -0.0f,  1.0f,
         1.0f, -1.0f,
    };

    static const float vertexColors[] = {
       1.0f, 0.0f, 0.0f,
       0.0f, 1.0f, 0.0f,
       0.0f, 0.0f, 1.0f
    };

    QOpenGLBuffer vertexPositionBuffer(QOpenGLBuffer::VertexBuffer);
    vertexPositionBuffer.create();
    vertexPositionBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexPositionBuffer.bind();
    vertexPositionBuffer.allocate(vertexPositions, 6 * sizeof(float));

    QOpenGLBuffer vertexColorBuffer(QOpenGLBuffer::VertexBuffer);
    vertexColorBuffer.create();
    vertexColorBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexColorBuffer.bind();
    vertexColorBuffer.allocate(vertexColors, 9 * sizeof(float));

    QOpenGLShaderProgram program;
    program.addShaderFromSourceCode(QOpenGLShader::Vertex,
                                   "#version 330\r\n"
                                   "in vec2 position;\n"
                                   "in vec3 color;\n"
                                   "out vec3 fragColor;\n"
                                   "void main() {\n"
                                   "    fragColor = color;\n"
                                   "    gl_Position = vec4(position, 0.0, 1.0);\n"
                                   "}\n"
                                   );
    program.addShaderFromSourceCode(QOpenGLShader::Fragment,
                                   "#version 330\r\n"
                                   "in vec3 fragColor;\n"
                                   "out vec4 color;\n"
                                   "void main() {\n"
                                   "    color = vec4(fragColor, 1.0);\n"
                                   "}\n"
                                   );
    program.link();
    program.bind();

    QOpenGLVertexArrayObject vao;
    vao.create();
    vao.bind();

    vertexPositionBuffer.bind();
    program.enableAttributeArray("position");
    program.setAttributeBuffer("position", GL_FLOAT, 0, 2);

    vertexColorBuffer.bind();
    program.enableAttributeArray("color");
    program.setAttributeBuffer("color", GL_FLOAT, 0, 3);

//    ==============DRAWING TO THE FBO============

  //  openGLContext.functions()->glActiveTexture(GL_TEXTURE0);
  //  openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);
   // openGLContext.functions()->glClearColor(0.3f, 0.0f, 0.7f, 1.0f);
  //  openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    openGLContext.functions()->glDrawArrays(GL_TRIANGLES, 0, 3);
    //openGLContext.functions()->glDrawArrays(GL_QUADS, 0, 3);
//   =============CLEANUP================== maybe not necessary
    program.disableAttributeArray("position");
    program.disableAttributeArray("color");
    program.release();
    fbo.release();

//    ========SAVE IMAGE===========

    QImage im = fbo.toImage();

    if (im.save("d://temp//asd.png")){
       qDebug("Image saved!!");
    }
}



void trigle3(){


    QSurfaceFormat surfaceFormat;
    surfaceFormat.setMajorVersion(4);
    surfaceFormat.setMinorVersion(3);

    QOpenGLContext openGLContext;
    openGLContext.setFormat(surfaceFormat);
    openGLContext.create();
    if(!openGLContext.isValid()) qDebug("Unable to create context");

    QOffscreenSurface surface;
    surface.setFormat(surfaceFormat);
    surface.create();
    if(!surface.isValid()) qDebug("Unable to create the Offscreen surface");

    openGLContext.makeCurrent(&surface);

//   Viewport size
    QSize vpSize = QSize(300, 300);

    QOpenGLFramebufferObjectFormat fboFormat;
    fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
    QOpenGLFramebufferObject fbo(vpSize, fboFormat);
    openGLContext.functions()->glViewport(0,0,vpSize.width(), vpSize.height());




        QImage img("d://temp//300.png");

        // Generate a texture ID
        GLuint textureID;
        openGLContext.functions()->glGenTextures(1, &textureID);

        // Bind the texture
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);

        // Set texture parameters (adjust as needed)
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

        // Load the image data into the texture
        openGLContext.functions()->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.width(), img.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());

        // Unbind the texture
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, 0);


    fbo.bind();

//    ========GEOMEETRY SETUP========

    static const float vertexPositions[] = {
        1.0f, -1.5f,
       -1.5f, -1.5f,
       -1.5f,  1.5f,
        1.5f,  1.5f
    };

    static const float vertexColors[] = {
        1.0f, 0.0f,
        0.0f, 0.0f,
        0.0f, 1.0f,
        1.0f, 1.0f
    };

    QOpenGLBuffer vertexPositionBuffer(QOpenGLBuffer::VertexBuffer);
    vertexPositionBuffer.create();
    vertexPositionBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexPositionBuffer.bind();
    vertexPositionBuffer.allocate(vertexPositions, 6 * sizeof(float));

    QOpenGLBuffer vertexColorBuffer(QOpenGLBuffer::VertexBuffer);
    vertexColorBuffer.create();
    vertexColorBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexColorBuffer.bind();
    vertexColorBuffer.allocate(vertexColors, 9 * sizeof(float));

    QOpenGLShaderProgram program;
    program.addShaderFromSourceCode(QOpenGLShader::Vertex,
                                   "#version 330\r\n"
                                   "in vec2 position;\n"
                                   "in vec2 color;\n"
                                   "out vec2 fragColor;\n"
                                   "void main() {\n"
                                   "    fragColor = color;\n"
                                   "    gl_Position = vec4(position, 0.0, 1.0);\n"
                                   "}\n"
                                   );
    program.addShaderFromSourceCode(QOpenGLShader::Fragment,
                                   "#version 330\r\n"
                                    "out vec4 renders;;\n"
                                   "in vec2 fragColor;\n"
                                   "uniform sampler2D ourTexture;\n"
                                   "void main() {\n"
                                   "    renders = texture(ourTexture, fragColor);\n"
                                   "}\n"
                                   );
    program.link();
    program.bind();

    QOpenGLVertexArrayObject vao;
    vao.create();
    vao.bind();

    vertexPositionBuffer.bind();
    program.enableAttributeArray("position");
    program.setAttributeBuffer("position", GL_FLOAT, 0, 2);

    vertexColorBuffer.bind();
    program.enableAttributeArray("color");
    program.setAttributeBuffer("color", GL_FLOAT, 0, 2);

    QOpenGLTexture texture(QOpenGLTexture::Target2D);
    program.bind();
    {
            texture.create();
            texture.setData(QImage("d://temp//300.png").mirrored());
            texture.setMinMagFilters(QOpenGLTexture::LinearMipMapLinear,QOpenGLTexture::Linear);
            texture.setWrapMode(QOpenGLTexture::DirectionS,QOpenGLTexture::Repeat);
            texture.setWrapMode(QOpenGLTexture::DirectionT,QOpenGLTexture::Repeat);
            texture.bind(0);                                    //将texture绑定到纹理单元0
                  program.setUniformValue("ourTexture", 0);      //让着色采样器ourTexture从纹理单元0中获取纹理数据
              //  openGLContext.functions()->QOpenGLVertexArrayObject::Binder{&VAO};
                  openGLContext.functions()->glDrawArrays(GL_TRIANGLES,0,4);     //使用以0开始，长度为4的顶点数据来绘制多边形
                  QImage im = fbo.toImage();

                  if (im.save("d://temp//asd.png")){
                     qDebug("Image saved!!");
                  }


    }



//    ==============DRAWING TO THE FBO============

  //  openGLContext.functions()->glActiveTexture(GL_TEXTURE0);
  //  openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);
   // openGLContext.functions()->glClearColor(0.3f, 0.0f, 0.7f, 1.0f);
  //  openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    openGLContext.functions()->glDrawArrays(GL_TRIANGLES, 0, 3);
    //openGLContext.functions()->glDrawArrays(GL_QUADS, 0, 3);
//   =============CLEANUP================== maybe not necessary
    program.disableAttributeArray("position");
    program.disableAttributeArray("color");
    program.release();
    fbo.release();

//    ========SAVE IMAGE===========

    QImage im = fbo.toImage();

    if (im.save("d://temp//asd.png")){
       qDebug("Image saved!!");
    }
}

void trigle4(){


    QSurfaceFormat surfaceFormat;
    surfaceFormat.setMajorVersion(2);
    surfaceFormat.setMinorVersion(2);

    QOpenGLContext openGLContext;
    openGLContext.setFormat(surfaceFormat);
    openGLContext.create();
    if(!openGLContext.isValid()) qDebug("Unable to create context");

    QOffscreenSurface surface;
    surface.setFormat(surfaceFormat);
    surface.create();
    if(!surface.isValid()) qDebug("Unable to create the Offscreen surface");

    openGLContext.makeCurrent(&surface);

//   Viewport size
    QSize vpSize = QSize(300, 300);

    QOpenGLFramebufferObjectFormat fboFormat;
    fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
    QOpenGLFramebufferObject fbo(vpSize, fboFormat);
    openGLContext.functions()->glViewport(0,0,vpSize.width(), vpSize.height());




        QImage img("d://temp//300.png");


    fbo.bind();

//    ========GEOMEETRY SETUP========

    QImage myimage("d://temp//300.png");


    int width = myimage.width();
    int height = myimage.height();
    B_[0][0] ={0 ,          0 , 0};
    B_[1][0] ={width / 3    ,0 , 0};
    B_[2][0] ={width * 2 / 3 ,    0 , 0};
    B_[3][0] ={width  ,0 , 0};

    B_[0][1] ={0 ,                  height / 3 , 0};
    B_[1][1] ={width   ,         height / 3 , 0};
    B_[2][1] ={width  * 2/  3 ,     height / 3 , 0};
    B_[3][1] ={width ,              height / 3 , 0};


    B_[0][2] ={0 ,                  height * 2 / 3 , 0};
    B_[1][2] ={width / 3 ,          height * 2 / 3 , 0};
    B_[2][2] ={width * 2 / 3 ,      height * 2 / 3 , 0};
    B_[3][2] ={width  ,             height * 2 / 3 , 0};

    B_[0][3] ={0 ,                  height , 0};
    B_[1][3] ={width / 3 ,          height , 0};
    B_[2][3] ={width * 2 / 3 ,      height , 0};
    B_[3][3] ={width  ,             height , 0};
    static  float vertexColors[3200] ={


        0 , 0,
        0.05 , 0,
        0.05 , 0.05,
        0 , 0.05,
        0 , 0.05,
        0.05 , 0.05,
        0.05 , 0.1,
        0 , 0.1,
        0 , 0.1,
        0.05 , 0.1,
        0.05 , 0.15,
        0 , 0.15,
        0 , 0.15,
        0.05 , 0.15,
        0.05 , 0.2,
        0 , 0.2,
        0 , 0.2,
        0.05 , 0.2,
        0.05 , 0.25,
        0 , 0.25,
        0 , 0.25,
        0.05 , 0.25,
        0.05 , 0.3,
        0 , 0.3,
        0 , 0.3,
        0.05 , 0.3,
        0.05 , 0.35,
        0 , 0.35,
        0 , 0.35,
        0.05 , 0.35,
        0.05 , 0.4,
        0 , 0.4,
        0 , 0.4,
        0.05 , 0.4,
        0.05 , 0.45,
        0 , 0.45,
        0 , 0.45,
        0.05 , 0.45,
        0.05 , 0.5,
        0 , 0.5,
        0 , 0.5,
        0.05 , 0.5,
        0.05 , 0.55,
        0 , 0.55,
        0 , 0.55,
        0.05 , 0.55,
        0.05 , 0.6,
        0 , 0.6,
        0 , 0.6,
        0.05 , 0.6,
        0.05 , 0.65,
        0 , 0.65,
        0 , 0.65,
        0.05 , 0.65,
        0.05 , 0.7,
        0 , 0.7,
        0 , 0.7,
        0.05 , 0.7,
        0.05 , 0.75,
        0 , 0.75,
        0 , 0.75,
        0.05 , 0.75,
        0.05 , 0.8,
        0 , 0.8,
        0 , 0.8,
        0.05 , 0.8,
        0.05 , 0.85,
        0 , 0.85,
        0 , 0.85,
        0.05 , 0.85,
        0.05 , 0.9,
        0 , 0.9,
        0 , 0.9,
        0.05 , 0.9,
        0.05 , 0.95,
        0 , 0.95,
        0 , 0.95,
        0.05 , 0.95,
        0.05 , 1,
        0 , 1,
        0.05 , 0,
        0.1 , 0,
        0.1 , 0.05,
        0.05 , 0.05,
        0.05 , 0.05,
        0.1 , 0.05,
        0.1 , 0.1,
        0.05 , 0.1,
        0.05 , 0.1,
        0.1 , 0.1,
        0.1 , 0.15,
        0.05 , 0.15,
        0.05 , 0.15,
        0.1 , 0.15,
        0.1 , 0.2,
        0.05 , 0.2,
        0.05 , 0.2,
        0.1 , 0.2,
        0.1 , 0.25,
        0.05 , 0.25,
        0.05 , 0.25,
        0.1 , 0.25,
        0.1 , 0.3,
        0.05 , 0.3,
        0.05 , 0.3,
        0.1 , 0.3,
        0.1 , 0.35,
        0.05 , 0.35,
        0.05 , 0.35,
        0.1 , 0.35,
        0.1 , 0.4,
        0.05 , 0.4,
        0.05 , 0.4,
        0.1 , 0.4,
        0.1 , 0.45,
        0.05 , 0.45,
        0.05 , 0.45,
        0.1 , 0.45,
        0.1 , 0.5,
        0.05 , 0.5,
        0.05 , 0.5,
        0.1 , 0.5,
        0.1 , 0.55,
        0.05 , 0.55,
        0.05 , 0.55,
        0.1 , 0.55,
        0.1 , 0.6,
        0.05 , 0.6,
        0.05 , 0.6,
        0.1 , 0.6,
        0.1 , 0.65,
        0.05 , 0.65,
        0.05 , 0.65,
        0.1 , 0.65,
        0.1 , 0.7,
        0.05 , 0.7,
        0.05 , 0.7,
        0.1 , 0.7,
        0.1 , 0.75,
        0.05 , 0.75,
        0.05 , 0.75,
        0.1 , 0.75,
        0.1 , 0.8,
        0.05 , 0.8,
        0.05 , 0.8,
        0.1 , 0.8,
        0.1 , 0.85,
        0.05 , 0.85,
        0.05 , 0.85,
        0.1 , 0.85,
        0.1 , 0.9,
        0.05 , 0.9,
        0.05 , 0.9,
        0.1 , 0.9,
        0.1 , 0.95,
        0.05 , 0.95,
        0.05 , 0.95,
        0.1 , 0.95,
        0.1 , 1,
        0.05 , 1,
        0.1 , 0,
        0.15 , 0,
        0.15 , 0.05,
        0.1 , 0.05,
        0.1 , 0.05,
        0.15 , 0.05,
        0.15 , 0.1,
        0.1 , 0.1,
        0.1 , 0.1,
        0.15 , 0.1,
        0.15 , 0.15,
        0.1 , 0.15,
        0.1 , 0.15,
        0.15 , 0.15,
        0.15 , 0.2,
        0.1 , 0.2,
        0.1 , 0.2,
        0.15 , 0.2,
        0.15 , 0.25,
        0.1 , 0.25,
        0.1 , 0.25,
        0.15 , 0.25,
        0.15 , 0.3,
        0.1 , 0.3,
        0.1 , 0.3,
        0.15 , 0.3,
        0.15 , 0.35,
        0.1 , 0.35,
        0.1 , 0.35,
        0.15 , 0.35,
        0.15 , 0.4,
        0.1 , 0.4,
        0.1 , 0.4,
        0.15 , 0.4,
        0.15 , 0.45,
        0.1 , 0.45,
        0.1 , 0.45,
        0.15 , 0.45,
        0.15 , 0.5,
        0.1 , 0.5,
        0.1 , 0.5,
        0.15 , 0.5,
        0.15 , 0.55,
        0.1 , 0.55,
        0.1 , 0.55,
        0.15 , 0.55,
        0.15 , 0.6,
        0.1 , 0.6,
        0.1 , 0.6,
        0.15 , 0.6,
        0.15 , 0.65,
        0.1 , 0.65,
        0.1 , 0.65,
        0.15 , 0.65,
        0.15 , 0.7,
        0.1 , 0.7,
        0.1 , 0.7,
        0.15 , 0.7,
        0.15 , 0.75,
        0.1 , 0.75,
        0.1 , 0.75,
        0.15 , 0.75,
        0.15 , 0.8,
        0.1 , 0.8,
        0.1 , 0.8,
        0.15 , 0.8,
        0.15 , 0.85,
        0.1 , 0.85,
        0.1 , 0.85,
        0.15 , 0.85,
        0.15 , 0.9,
        0.1 , 0.9,
        0.1 , 0.9,
        0.15 , 0.9,
        0.15 , 0.95,
        0.1 , 0.95,
        0.1 , 0.95,
        0.15 , 0.95,
        0.15 , 1,
        0.1 , 1,
        0.15 , 0,
        0.2 , 0,
        0.2 , 0.05,
        0.15 , 0.05,
        0.15 , 0.05,
        0.2 , 0.05,
        0.2 , 0.1,
        0.15 , 0.1,
        0.15 , 0.1,
        0.2 , 0.1,
        0.2 , 0.15,
        0.15 , 0.15,
        0.15 , 0.15,
        0.2 , 0.15,
        0.2 , 0.2,
        0.15 , 0.2,
        0.15 , 0.2,
        0.2 , 0.2,
        0.2 , 0.25,
        0.15 , 0.25,
        0.15 , 0.25,
        0.2 , 0.25,
        0.2 , 0.3,
        0.15 , 0.3,
        0.15 , 0.3,
        0.2 , 0.3,
        0.2 , 0.35,
        0.15 , 0.35,
        0.15 , 0.35,
        0.2 , 0.35,
        0.2 , 0.4,
        0.15 , 0.4,
        0.15 , 0.4,
        0.2 , 0.4,
        0.2 , 0.45,
        0.15 , 0.45,
        0.15 , 0.45,
        0.2 , 0.45,
        0.2 , 0.5,
        0.15 , 0.5,
        0.15 , 0.5,
        0.2 , 0.5,
        0.2 , 0.55,
        0.15 , 0.55,
        0.15 , 0.55,
        0.2 , 0.55,
        0.2 , 0.6,
        0.15 , 0.6,
        0.15 , 0.6,
        0.2 , 0.6,
        0.2 , 0.65,
        0.15 , 0.65,
        0.15 , 0.65,
        0.2 , 0.65,
        0.2 , 0.7,
        0.15 , 0.7,
        0.15 , 0.7,
        0.2 , 0.7,
        0.2 , 0.75,
        0.15 , 0.75,
        0.15 , 0.75,
        0.2 , 0.75,
        0.2 , 0.8,
        0.15 , 0.8,
        0.15 , 0.8,
        0.2 , 0.8,
        0.2 , 0.85,
        0.15 , 0.85,
        0.15 , 0.85,
        0.2 , 0.85,
        0.2 , 0.9,
        0.15 , 0.9,
        0.15 , 0.9,
        0.2 , 0.9,
        0.2 , 0.95,
        0.15 , 0.95,
        0.15 , 0.95,
        0.2 , 0.95,
        0.2 , 1,
        0.15 , 1,
        0.2 , 0,
        0.25 , 0,
        0.25 , 0.05,
        0.2 , 0.05,
        0.2 , 0.05,
        0.25 , 0.05,
        0.25 , 0.1,
        0.2 , 0.1,
        0.2 , 0.1,
        0.25 , 0.1,
        0.25 , 0.15,
        0.2 , 0.15,
        0.2 , 0.15,
        0.25 , 0.15,
        0.25 , 0.2,
        0.2 , 0.2,
        0.2 , 0.2,
        0.25 , 0.2,
        0.25 , 0.25,
        0.2 , 0.25,
        0.2 , 0.25,
        0.25 , 0.25,
        0.25 , 0.3,
        0.2 , 0.3,
        0.2 , 0.3,
        0.25 , 0.3,
        0.25 , 0.35,
        0.2 , 0.35,
        0.2 , 0.35,
        0.25 , 0.35,
        0.25 , 0.4,
        0.2 , 0.4,
        0.2 , 0.4,
        0.25 , 0.4,
        0.25 , 0.45,
        0.2 , 0.45,
        0.2 , 0.45,
        0.25 , 0.45,
        0.25 , 0.5,
        0.2 , 0.5,
        0.2 , 0.5,
        0.25 , 0.5,
        0.25 , 0.55,
        0.2 , 0.55,
        0.2 , 0.55,
        0.25 , 0.55,
        0.25 , 0.6,
        0.2 , 0.6,
        0.2 , 0.6,
        0.25 , 0.6,
        0.25 , 0.65,
        0.2 , 0.65,
        0.2 , 0.65,
        0.25 , 0.65,
        0.25 , 0.7,
        0.2 , 0.7,
        0.2 , 0.7,
        0.25 , 0.7,
        0.25 , 0.75,
        0.2 , 0.75,
        0.2 , 0.75,
        0.25 , 0.75,
        0.25 , 0.8,
        0.2 , 0.8,
        0.2 , 0.8,
        0.25 , 0.8,
        0.25 , 0.85,
        0.2 , 0.85,
        0.2 , 0.85,
        0.25 , 0.85,
        0.25 , 0.9,
        0.2 , 0.9,
        0.2 , 0.9,
        0.25 , 0.9,
        0.25 , 0.95,
        0.2 , 0.95,
        0.2 , 0.95,
        0.25 , 0.95,
        0.25 , 1,
        0.2 , 1,
        0.25 , 0,
        0.3 , 0,
        0.3 , 0.05,
        0.25 , 0.05,
        0.25 , 0.05,
        0.3 , 0.05,
        0.3 , 0.1,
        0.25 , 0.1,
        0.25 , 0.1,
        0.3 , 0.1,
        0.3 , 0.15,
        0.25 , 0.15,
        0.25 , 0.15,
        0.3 , 0.15,
        0.3 , 0.2,
        0.25 , 0.2,
        0.25 , 0.2,
        0.3 , 0.2,
        0.3 , 0.25,
        0.25 , 0.25,
        0.25 , 0.25,
        0.3 , 0.25,
        0.3 , 0.3,
        0.25 , 0.3,
        0.25 , 0.3,
        0.3 , 0.3,
        0.3 , 0.35,
        0.25 , 0.35,
        0.25 , 0.35,
        0.3 , 0.35,
        0.3 , 0.4,
        0.25 , 0.4,
        0.25 , 0.4,
        0.3 , 0.4,
        0.3 , 0.45,
        0.25 , 0.45,
        0.25 , 0.45,
        0.3 , 0.45,
        0.3 , 0.5,
        0.25 , 0.5,
        0.25 , 0.5,
        0.3 , 0.5,
        0.3 , 0.55,
        0.25 , 0.55,
        0.25 , 0.55,
        0.3 , 0.55,
        0.3 , 0.6,
        0.25 , 0.6,
        0.25 , 0.6,
        0.3 , 0.6,
        0.3 , 0.65,
        0.25 , 0.65,
        0.25 , 0.65,
        0.3 , 0.65,
        0.3 , 0.7,
        0.25 , 0.7,
        0.25 , 0.7,
        0.3 , 0.7,
        0.3 , 0.75,
        0.25 , 0.75,
        0.25 , 0.75,
        0.3 , 0.75,
        0.3 , 0.8,
        0.25 , 0.8,
        0.25 , 0.8,
        0.3 , 0.8,
        0.3 , 0.85,
        0.25 , 0.85,
        0.25 , 0.85,
        0.3 , 0.85,
        0.3 , 0.9,
        0.25 , 0.9,
        0.25 , 0.9,
        0.3 , 0.9,
        0.3 , 0.95,
        0.25 , 0.95,
        0.25 , 0.95,
        0.3 , 0.95,
        0.3 , 1,
        0.25 , 1,
        0.3 , 0,
        0.35 , 0,
        0.35 , 0.05,
        0.3 , 0.05,
        0.3 , 0.05,
        0.35 , 0.05,
        0.35 , 0.1,
        0.3 , 0.1,
        0.3 , 0.1,
        0.35 , 0.1,
        0.35 , 0.15,
        0.3 , 0.15,
        0.3 , 0.15,
        0.35 , 0.15,
        0.35 , 0.2,
        0.3 , 0.2,
        0.3 , 0.2,
        0.35 , 0.2,
        0.35 , 0.25,
        0.3 , 0.25,
        0.3 , 0.25,
        0.35 , 0.25,
        0.35 , 0.3,
        0.3 , 0.3,
        0.3 , 0.3,
        0.35 , 0.3,
        0.35 , 0.35,
        0.3 , 0.35,
        0.3 , 0.35,
        0.35 , 0.35,
        0.35 , 0.4,
        0.3 , 0.4,
        0.3 , 0.4,
        0.35 , 0.4,
        0.35 , 0.45,
        0.3 , 0.45,
        0.3 , 0.45,
        0.35 , 0.45,
        0.35 , 0.5,
        0.3 , 0.5,
        0.3 , 0.5,
        0.35 , 0.5,
        0.35 , 0.55,
        0.3 , 0.55,
        0.3 , 0.55,
        0.35 , 0.55,
        0.35 , 0.6,
        0.3 , 0.6,
        0.3 , 0.6,
        0.35 , 0.6,
        0.35 , 0.65,
        0.3 , 0.65,
        0.3 , 0.65,
        0.35 , 0.65,
        0.35 , 0.7,
        0.3 , 0.7,
        0.3 , 0.7,
        0.35 , 0.7,
        0.35 , 0.75,
        0.3 , 0.75,
        0.3 , 0.75,
        0.35 , 0.75,
        0.35 , 0.8,
        0.3 , 0.8,
        0.3 , 0.8,
        0.35 , 0.8,
        0.35 , 0.85,
        0.3 , 0.85,
        0.3 , 0.85,
        0.35 , 0.85,
        0.35 , 0.9,
        0.3 , 0.9,
        0.3 , 0.9,
        0.35 , 0.9,
        0.35 , 0.95,
        0.3 , 0.95,
        0.3 , 0.95,
        0.35 , 0.95,
        0.35 , 1,
        0.3 , 1,
        0.35 , 0,
        0.4 , 0,
        0.4 , 0.05,
        0.35 , 0.05,
        0.35 , 0.05,
        0.4 , 0.05,
        0.4 , 0.1,
        0.35 , 0.1,
        0.35 , 0.1,
        0.4 , 0.1,
        0.4 , 0.15,
        0.35 , 0.15,
        0.35 , 0.15,
        0.4 , 0.15,
        0.4 , 0.2,
        0.35 , 0.2,
        0.35 , 0.2,
        0.4 , 0.2,
        0.4 , 0.25,
        0.35 , 0.25,
        0.35 , 0.25,
        0.4 , 0.25,
        0.4 , 0.3,
        0.35 , 0.3,
        0.35 , 0.3,
        0.4 , 0.3,
        0.4 , 0.35,
        0.35 , 0.35,
        0.35 , 0.35,
        0.4 , 0.35,
        0.4 , 0.4,
        0.35 , 0.4,
        0.35 , 0.4,
        0.4 , 0.4,
        0.4 , 0.45,
        0.35 , 0.45,
        0.35 , 0.45,
        0.4 , 0.45,
        0.4 , 0.5,
        0.35 , 0.5,
        0.35 , 0.5,
        0.4 , 0.5,
        0.4 , 0.55,
        0.35 , 0.55,
        0.35 , 0.55,
        0.4 , 0.55,
        0.4 , 0.6,
        0.35 , 0.6,
        0.35 , 0.6,
        0.4 , 0.6,
        0.4 , 0.65,
        0.35 , 0.65,
        0.35 , 0.65,
        0.4 , 0.65,
        0.4 , 0.7,
        0.35 , 0.7,
        0.35 , 0.7,
        0.4 , 0.7,
        0.4 , 0.75,
        0.35 , 0.75,
        0.35 , 0.75,
        0.4 , 0.75,
        0.4 , 0.8,
        0.35 , 0.8,
        0.35 , 0.8,
        0.4 , 0.8,
        0.4 , 0.85,
        0.35 , 0.85,
        0.35 , 0.85,
        0.4 , 0.85,
        0.4 , 0.9,
        0.35 , 0.9,
        0.35 , 0.9,
        0.4 , 0.9,
        0.4 , 0.95,
        0.35 , 0.95,
        0.35 , 0.95,
        0.4 , 0.95,
        0.4 , 1,
        0.35 , 1,
        0.4 , 0,
        0.45 , 0,
        0.45 , 0.05,
        0.4 , 0.05,
        0.4 , 0.05,
        0.45 , 0.05,
        0.45 , 0.1,
        0.4 , 0.1,
        0.4 , 0.1,
        0.45 , 0.1,
        0.45 , 0.15,
        0.4 , 0.15,
        0.4 , 0.15,
        0.45 , 0.15,
        0.45 , 0.2,
        0.4 , 0.2,
        0.4 , 0.2,
        0.45 , 0.2,
        0.45 , 0.25,
        0.4 , 0.25,
        0.4 , 0.25,
        0.45 , 0.25,
        0.45 , 0.3,
        0.4 , 0.3,
        0.4 , 0.3,
        0.45 , 0.3,
        0.45 , 0.35,
        0.4 , 0.35,
        0.4 , 0.35,
        0.45 , 0.35,
        0.45 , 0.4,
        0.4 , 0.4,
        0.4 , 0.4,
        0.45 , 0.4,
        0.45 , 0.45,
        0.4 , 0.45,
        0.4 , 0.45,
        0.45 , 0.45,
        0.45 , 0.5,
        0.4 , 0.5,
        0.4 , 0.5,
        0.45 , 0.5,
        0.45 , 0.55,
        0.4 , 0.55,
        0.4 , 0.55,
        0.45 , 0.55,
        0.45 , 0.6,
        0.4 , 0.6,
        0.4 , 0.6,
        0.45 , 0.6,
        0.45 , 0.65,
        0.4 , 0.65,
        0.4 , 0.65,
        0.45 , 0.65,
        0.45 , 0.7,
        0.4 , 0.7,
        0.4 , 0.7,
        0.45 , 0.7,
        0.45 , 0.75,
        0.4 , 0.75,
        0.4 , 0.75,
        0.45 , 0.75,
        0.45 , 0.8,
        0.4 , 0.8,
        0.4 , 0.8,
        0.45 , 0.8,
        0.45 , 0.85,
        0.4 , 0.85,
        0.4 , 0.85,
        0.45 , 0.85,
        0.45 , 0.9,
        0.4 , 0.9,
        0.4 , 0.9,
        0.45 , 0.9,
        0.45 , 0.95,
        0.4 , 0.95,
        0.4 , 0.95,
        0.45 , 0.95,
        0.45 , 1,
        0.4 , 1,
        0.45 , 0,
        0.5 , 0,
        0.5 , 0.05,
        0.45 , 0.05,
        0.45 , 0.05,
        0.5 , 0.05,
        0.5 , 0.1,
        0.45 , 0.1,
        0.45 , 0.1,
        0.5 , 0.1,
        0.5 , 0.15,
        0.45 , 0.15,
        0.45 , 0.15,
        0.5 , 0.15,
        0.5 , 0.2,
        0.45 , 0.2,
        0.45 , 0.2,
        0.5 , 0.2,
        0.5 , 0.25,
        0.45 , 0.25,
        0.45 , 0.25,
        0.5 , 0.25,
        0.5 , 0.3,
        0.45 , 0.3,
        0.45 , 0.3,
        0.5 , 0.3,
        0.5 , 0.35,
        0.45 , 0.35,
        0.45 , 0.35,
        0.5 , 0.35,
        0.5 , 0.4,
        0.45 , 0.4,
        0.45 , 0.4,
        0.5 , 0.4,
        0.5 , 0.45,
        0.45 , 0.45,
        0.45 , 0.45,
        0.5 , 0.45,
        0.5 , 0.5,
        0.45 , 0.5,
        0.45 , 0.5,
        0.5 , 0.5,
        0.5 , 0.55,
        0.45 , 0.55,
        0.45 , 0.55,
        0.5 , 0.55,
        0.5 , 0.6,
        0.45 , 0.6,
        0.45 , 0.6,
        0.5 , 0.6,
        0.5 , 0.65,
        0.45 , 0.65,
        0.45 , 0.65,
        0.5 , 0.65,
        0.5 , 0.7,
        0.45 , 0.7,
        0.45 , 0.7,
        0.5 , 0.7,
        0.5 , 0.75,
        0.45 , 0.75,
        0.45 , 0.75,
        0.5 , 0.75,
        0.5 , 0.8,
        0.45 , 0.8,
        0.45 , 0.8,
        0.5 , 0.8,
        0.5 , 0.85,
        0.45 , 0.85,
        0.45 , 0.85,
        0.5 , 0.85,
        0.5 , 0.9,
        0.45 , 0.9,
        0.45 , 0.9,
        0.5 , 0.9,
        0.5 , 0.95,
        0.45 , 0.95,
        0.45 , 0.95,
        0.5 , 0.95,
        0.5 , 1,
        0.45 , 1,
        0.5 , 0,
        0.55 , 0,
        0.55 , 0.05,
        0.5 , 0.05,
        0.5 , 0.05,
        0.55 , 0.05,
        0.55 , 0.1,
        0.5 , 0.1,
        0.5 , 0.1,
        0.55 , 0.1,
        0.55 , 0.15,
        0.5 , 0.15,
        0.5 , 0.15,
        0.55 , 0.15,
        0.55 , 0.2,
        0.5 , 0.2,
        0.5 , 0.2,
        0.55 , 0.2,
        0.55 , 0.25,
        0.5 , 0.25,
        0.5 , 0.25,
        0.55 , 0.25,
        0.55 , 0.3,
        0.5 , 0.3,
        0.5 , 0.3,
        0.55 , 0.3,
        0.55 , 0.35,
        0.5 , 0.35,
        0.5 , 0.35,
        0.55 , 0.35,
        0.55 , 0.4,
        0.5 , 0.4,
        0.5 , 0.4,
        0.55 , 0.4,
        0.55 , 0.45,
        0.5 , 0.45,
        0.5 , 0.45,
        0.55 , 0.45,
        0.55 , 0.5,
        0.5 , 0.5,
        0.5 , 0.5,
        0.55 , 0.5,
        0.55 , 0.55,
        0.5 , 0.55,
        0.5 , 0.55,
        0.55 , 0.55,
        0.55 , 0.6,
        0.5 , 0.6,
        0.5 , 0.6,
        0.55 , 0.6,
        0.55 , 0.65,
        0.5 , 0.65,
        0.5 , 0.65,
        0.55 , 0.65,
        0.55 , 0.7,
        0.5 , 0.7,
        0.5 , 0.7,
        0.55 , 0.7,
        0.55 , 0.75,
        0.5 , 0.75,
        0.5 , 0.75,
        0.55 , 0.75,
        0.55 , 0.8,
        0.5 , 0.8,
        0.5 , 0.8,
        0.55 , 0.8,
        0.55 , 0.85,
        0.5 , 0.85,
        0.5 , 0.85,
        0.55 , 0.85,
        0.55 , 0.9,
        0.5 , 0.9,
        0.5 , 0.9,
        0.55 , 0.9,
        0.55 , 0.95,
        0.5 , 0.95,
        0.5 , 0.95,
        0.55 , 0.95,
        0.55 , 1,
        0.5 , 1,
        0.55 , 0,
        0.6 , 0,
        0.6 , 0.05,
        0.55 , 0.05,
        0.55 , 0.05,
        0.6 , 0.05,
        0.6 , 0.1,
        0.55 , 0.1,
        0.55 , 0.1,
        0.6 , 0.1,
        0.6 , 0.15,
        0.55 , 0.15,
        0.55 , 0.15,
        0.6 , 0.15,
        0.6 , 0.2,
        0.55 , 0.2,
        0.55 , 0.2,
        0.6 , 0.2,
        0.6 , 0.25,
        0.55 , 0.25,
        0.55 , 0.25,
        0.6 , 0.25,
        0.6 , 0.3,
        0.55 , 0.3,
        0.55 , 0.3,
        0.6 , 0.3,
        0.6 , 0.35,
        0.55 , 0.35,
        0.55 , 0.35,
        0.6 , 0.35,
        0.6 , 0.4,
        0.55 , 0.4,
        0.55 , 0.4,
        0.6 , 0.4,
        0.6 , 0.45,
        0.55 , 0.45,
        0.55 , 0.45,
        0.6 , 0.45,
        0.6 , 0.5,
        0.55 , 0.5,
        0.55 , 0.5,
        0.6 , 0.5,
        0.6 , 0.55,
        0.55 , 0.55,
        0.55 , 0.55,
        0.6 , 0.55,
        0.6 , 0.6,
        0.55 , 0.6,
        0.55 , 0.6,
        0.6 , 0.6,
        0.6 , 0.65,
        0.55 , 0.65,
        0.55 , 0.65,
        0.6 , 0.65,
        0.6 , 0.7,
        0.55 , 0.7,
        0.55 , 0.7,
        0.6 , 0.7,
        0.6 , 0.75,
        0.55 , 0.75,
        0.55 , 0.75,
        0.6 , 0.75,
        0.6 , 0.8,
        0.55 , 0.8,
        0.55 , 0.8,
        0.6 , 0.8,
        0.6 , 0.85,
        0.55 , 0.85,
        0.55 , 0.85,
        0.6 , 0.85,
        0.6 , 0.9,
        0.55 , 0.9,
        0.55 , 0.9,
        0.6 , 0.9,
        0.6 , 0.95,
        0.55 , 0.95,
        0.55 , 0.95,
        0.6 , 0.95,
        0.6 , 1,
        0.55 , 1,
        0.6 , 0,
        0.65 , 0,
        0.65 , 0.05,
        0.6 , 0.05,
        0.6 , 0.05,
        0.65 , 0.05,
        0.65 , 0.1,
        0.6 , 0.1,
        0.6 , 0.1,
        0.65 , 0.1,
        0.65 , 0.15,
        0.6 , 0.15,
        0.6 , 0.15,
        0.65 , 0.15,
        0.65 , 0.2,
        0.6 , 0.2,
        0.6 , 0.2,
        0.65 , 0.2,
        0.65 , 0.25,
        0.6 , 0.25,
        0.6 , 0.25,
        0.65 , 0.25,
        0.65 , 0.3,
        0.6 , 0.3,
        0.6 , 0.3,
        0.65 , 0.3,
        0.65 , 0.35,
        0.6 , 0.35,
        0.6 , 0.35,
        0.65 , 0.35,
        0.65 , 0.4,
        0.6 , 0.4,
        0.6 , 0.4,
        0.65 , 0.4,
        0.65 , 0.45,
        0.6 , 0.45,
        0.6 , 0.45,
        0.65 , 0.45,
        0.65 , 0.5,
        0.6 , 0.5,
        0.6 , 0.5,
        0.65 , 0.5,
        0.65 , 0.55,
        0.6 , 0.55,
        0.6 , 0.55,
        0.65 , 0.55,
        0.65 , 0.6,
        0.6 , 0.6,
        0.6 , 0.6,
        0.65 , 0.6,
        0.65 , 0.65,
        0.6 , 0.65,
        0.6 , 0.65,
        0.65 , 0.65,
        0.65 , 0.7,
        0.6 , 0.7,
        0.6 , 0.7,
        0.65 , 0.7,
        0.65 , 0.75,
        0.6 , 0.75,
        0.6 , 0.75,
        0.65 , 0.75,
        0.65 , 0.8,
        0.6 , 0.8,
        0.6 , 0.8,
        0.65 , 0.8,
        0.65 , 0.85,
        0.6 , 0.85,
        0.6 , 0.85,
        0.65 , 0.85,
        0.65 , 0.9,
        0.6 , 0.9,
        0.6 , 0.9,
        0.65 , 0.9,
        0.65 , 0.95,
        0.6 , 0.95,
        0.6 , 0.95,
        0.65 , 0.95,
        0.65 , 1,
        0.6 , 1,
        0.65 , 0,
        0.7 , 0,
        0.7 , 0.05,
        0.65 , 0.05,
        0.65 , 0.05,
        0.7 , 0.05,
        0.7 , 0.1,
        0.65 , 0.1,
        0.65 , 0.1,
        0.7 , 0.1,
        0.7 , 0.15,
        0.65 , 0.15,
        0.65 , 0.15,
        0.7 , 0.15,
        0.7 , 0.2,
        0.65 , 0.2,
        0.65 , 0.2,
        0.7 , 0.2,
        0.7 , 0.25,
        0.65 , 0.25,
        0.65 , 0.25,
        0.7 , 0.25,
        0.7 , 0.3,
        0.65 , 0.3,
        0.65 , 0.3,
        0.7 , 0.3,
        0.7 , 0.35,
        0.65 , 0.35,
        0.65 , 0.35,
        0.7 , 0.35,
        0.7 , 0.4,
        0.65 , 0.4,
        0.65 , 0.4,
        0.7 , 0.4,
        0.7 , 0.45,
        0.65 , 0.45,
        0.65 , 0.45,
        0.7 , 0.45,
        0.7 , 0.5,
        0.65 , 0.5,
        0.65 , 0.5,
        0.7 , 0.5,
        0.7 , 0.55,
        0.65 , 0.55,
        0.65 , 0.55,
        0.7 , 0.55,
        0.7 , 0.6,
        0.65 , 0.6,
        0.65 , 0.6,
        0.7 , 0.6,
        0.7 , 0.65,
        0.65 , 0.65,
        0.65 , 0.65,
        0.7 , 0.65,
        0.7 , 0.7,
        0.65 , 0.7,
        0.65 , 0.7,
        0.7 , 0.7,
        0.7 , 0.75,
        0.65 , 0.75,
        0.65 , 0.75,
        0.7 , 0.75,
        0.7 , 0.8,
        0.65 , 0.8,
        0.65 , 0.8,
        0.7 , 0.8,
        0.7 , 0.85,
        0.65 , 0.85,
        0.65 , 0.85,
        0.7 , 0.85,
        0.7 , 0.9,
        0.65 , 0.9,
        0.65 , 0.9,
        0.7 , 0.9,
        0.7 , 0.95,
        0.65 , 0.95,
        0.65 , 0.95,
        0.7 , 0.95,
        0.7 , 1,
        0.65 , 1,
        0.7 , 0,
        0.75 , 0,
        0.75 , 0.05,
        0.7 , 0.05,
        0.7 , 0.05,
        0.75 , 0.05,
        0.75 , 0.1,
        0.7 , 0.1,
        0.7 , 0.1,
        0.75 , 0.1,
        0.75 , 0.15,
        0.7 , 0.15,
        0.7 , 0.15,
        0.75 , 0.15,
        0.75 , 0.2,
        0.7 , 0.2,
        0.7 , 0.2,
        0.75 , 0.2,
        0.75 , 0.25,
        0.7 , 0.25,
        0.7 , 0.25,
        0.75 , 0.25,
        0.75 , 0.3,
        0.7 , 0.3,
        0.7 , 0.3,
        0.75 , 0.3,
        0.75 , 0.35,
        0.7 , 0.35,
        0.7 , 0.35,
        0.75 , 0.35,
        0.75 , 0.4,
        0.7 , 0.4,
        0.7 , 0.4,
        0.75 , 0.4,
        0.75 , 0.45,
        0.7 , 0.45,
        0.7 , 0.45,
        0.75 , 0.45,
        0.75 , 0.5,
        0.7 , 0.5,
        0.7 , 0.5,
        0.75 , 0.5,
        0.75 , 0.55,
        0.7 , 0.55,
        0.7 , 0.55,
        0.75 , 0.55,
        0.75 , 0.6,
        0.7 , 0.6,
        0.7 , 0.6,
        0.75 , 0.6,
        0.75 , 0.65,
        0.7 , 0.65,
        0.7 , 0.65,
        0.75 , 0.65,
        0.75 , 0.7,
        0.7 , 0.7,
        0.7 , 0.7,
        0.75 , 0.7,
        0.75 , 0.75,
        0.7 , 0.75,
        0.7 , 0.75,
        0.75 , 0.75,
        0.75 , 0.8,
        0.7 , 0.8,
        0.7 , 0.8,
        0.75 , 0.8,
        0.75 , 0.85,
        0.7 , 0.85,
        0.7 , 0.85,
        0.75 , 0.85,
        0.75 , 0.9,
        0.7 , 0.9,
        0.7 , 0.9,
        0.75 , 0.9,
        0.75 , 0.95,
        0.7 , 0.95,
        0.7 , 0.95,
        0.75 , 0.95,
        0.75 , 1,
        0.7 , 1,
        0.75 , 0,
        0.8 , 0,
        0.8 , 0.05,
        0.75 , 0.05,
        0.75 , 0.05,
        0.8 , 0.05,
        0.8 , 0.1,
        0.75 , 0.1,
        0.75 , 0.1,
        0.8 , 0.1,
        0.8 , 0.15,
        0.75 , 0.15,
        0.75 , 0.15,
        0.8 , 0.15,
        0.8 , 0.2,
        0.75 , 0.2,
        0.75 , 0.2,
        0.8 , 0.2,
        0.8 , 0.25,
        0.75 , 0.25,
        0.75 , 0.25,
        0.8 , 0.25,
        0.8 , 0.3,
        0.75 , 0.3,
        0.75 , 0.3,
        0.8 , 0.3,
        0.8 , 0.35,
        0.75 , 0.35,
        0.75 , 0.35,
        0.8 , 0.35,
        0.8 , 0.4,
        0.75 , 0.4,
        0.75 , 0.4,
        0.8 , 0.4,
        0.8 , 0.45,
        0.75 , 0.45,
        0.75 , 0.45,
        0.8 , 0.45,
        0.8 , 0.5,
        0.75 , 0.5,
        0.75 , 0.5,
        0.8 , 0.5,
        0.8 , 0.55,
        0.75 , 0.55,
        0.75 , 0.55,
        0.8 , 0.55,
        0.8 , 0.6,
        0.75 , 0.6,
        0.75 , 0.6,
        0.8 , 0.6,
        0.8 , 0.65,
        0.75 , 0.65,
        0.75 , 0.65,
        0.8 , 0.65,
        0.8 , 0.7,
        0.75 , 0.7,
        0.75 , 0.7,
        0.8 , 0.7,
        0.8 , 0.75,
        0.75 , 0.75,
        0.75 , 0.75,
        0.8 , 0.75,
        0.8 , 0.8,
        0.75 , 0.8,
        0.75 , 0.8,
        0.8 , 0.8,
        0.8 , 0.85,
        0.75 , 0.85,
        0.75 , 0.85,
        0.8 , 0.85,
        0.8 , 0.9,
        0.75 , 0.9,
        0.75 , 0.9,
        0.8 , 0.9,
        0.8 , 0.95,
        0.75 , 0.95,
        0.75 , 0.95,
        0.8 , 0.95,
        0.8 , 1,
        0.75 , 1,
        0.8 , 0,
        0.85 , 0,
        0.85 , 0.05,
        0.8 , 0.05,
        0.8 , 0.05,
        0.85 , 0.05,
        0.85 , 0.1,
        0.8 , 0.1,
        0.8 , 0.1,
        0.85 , 0.1,
        0.85 , 0.15,
        0.8 , 0.15,
        0.8 , 0.15,
        0.85 , 0.15,
        0.85 , 0.2,
        0.8 , 0.2,
        0.8 , 0.2,
        0.85 , 0.2,
        0.85 , 0.25,
        0.8 , 0.25,
        0.8 , 0.25,
        0.85 , 0.25,
        0.85 , 0.3,
        0.8 , 0.3,
        0.8 , 0.3,
        0.85 , 0.3,
        0.85 , 0.35,
        0.8 , 0.35,
        0.8 , 0.35,
        0.85 , 0.35,
        0.85 , 0.4,
        0.8 , 0.4,
        0.8 , 0.4,
        0.85 , 0.4,
        0.85 , 0.45,
        0.8 , 0.45,
        0.8 , 0.45,
        0.85 , 0.45,
        0.85 , 0.5,
        0.8 , 0.5,
        0.8 , 0.5,
        0.85 , 0.5,
        0.85 , 0.55,
        0.8 , 0.55,
        0.8 , 0.55,
        0.85 , 0.55,
        0.85 , 0.6,
        0.8 , 0.6,
        0.8 , 0.6,
        0.85 , 0.6,
        0.85 , 0.65,
        0.8 , 0.65,
        0.8 , 0.65,
        0.85 , 0.65,
        0.85 , 0.7,
        0.8 , 0.7,
        0.8 , 0.7,
        0.85 , 0.7,
        0.85 , 0.75,
        0.8 , 0.75,
        0.8 , 0.75,
        0.85 , 0.75,
        0.85 , 0.8,
        0.8 , 0.8,
        0.8 , 0.8,
        0.85 , 0.8,
        0.85 , 0.85,
        0.8 , 0.85,
        0.8 , 0.85,
        0.85 , 0.85,
        0.85 , 0.9,
        0.8 , 0.9,
        0.8 , 0.9,
        0.85 , 0.9,
        0.85 , 0.95,
        0.8 , 0.95,
        0.8 , 0.95,
        0.85 , 0.95,
        0.85 , 1,
        0.8 , 1,
        0.85 , 0,
        0.9 , 0,
        0.9 , 0.05,
        0.85 , 0.05,
        0.85 , 0.05,
        0.9 , 0.05,
        0.9 , 0.1,
        0.85 , 0.1,
        0.85 , 0.1,
        0.9 , 0.1,
        0.9 , 0.15,
        0.85 , 0.15,
        0.85 , 0.15,
        0.9 , 0.15,
        0.9 , 0.2,
        0.85 , 0.2,
        0.85 , 0.2,
        0.9 , 0.2,
        0.9 , 0.25,
        0.85 , 0.25,
        0.85 , 0.25,
        0.9 , 0.25,
        0.9 , 0.3,
        0.85 , 0.3,
        0.85 , 0.3,
        0.9 , 0.3,
        0.9 , 0.35,
        0.85 , 0.35,
        0.85 , 0.35,
        0.9 , 0.35,
        0.9 , 0.4,
        0.85 , 0.4,
        0.85 , 0.4,
        0.9 , 0.4,
        0.9 , 0.45,
        0.85 , 0.45,
        0.85 , 0.45,
        0.9 , 0.45,
        0.9 , 0.5,
        0.85 , 0.5,
        0.85 , 0.5,
        0.9 , 0.5,
        0.9 , 0.55,
        0.85 , 0.55,
        0.85 , 0.55,
        0.9 , 0.55,
        0.9 , 0.6,
        0.85 , 0.6,
        0.85 , 0.6,
        0.9 , 0.6,
        0.9 , 0.65,
        0.85 , 0.65,
        0.85 , 0.65,
        0.9 , 0.65,
        0.9 , 0.7,
        0.85 , 0.7,
        0.85 , 0.7,
        0.9 , 0.7,
        0.9 , 0.75,
        0.85 , 0.75,
        0.85 , 0.75,
        0.9 , 0.75,
        0.9 , 0.8,
        0.85 , 0.8,
        0.85 , 0.8,
        0.9 , 0.8,
        0.9 , 0.85,
        0.85 , 0.85,
        0.85 , 0.85,
        0.9 , 0.85,
        0.9 , 0.9,
        0.85 , 0.9,
        0.85 , 0.9,
        0.9 , 0.9,
        0.9 , 0.95,
        0.85 , 0.95,
        0.85 , 0.95,
        0.9 , 0.95,
        0.9 , 1,
        0.85 , 1,
        0.9 , 0,
        0.95 , 0,
        0.95 , 0.05,
        0.9 , 0.05,
        0.9 , 0.05,
        0.95 , 0.05,
        0.95 , 0.1,
        0.9 , 0.1,
        0.9 , 0.1,
        0.95 , 0.1,
        0.95 , 0.15,
        0.9 , 0.15,
        0.9 , 0.15,
        0.95 , 0.15,
        0.95 , 0.2,
        0.9 , 0.2,
        0.9 , 0.2,
        0.95 , 0.2,
        0.95 , 0.25,
        0.9 , 0.25,
        0.9 , 0.25,
        0.95 , 0.25,
        0.95 , 0.3,
        0.9 , 0.3,
        0.9 , 0.3,
        0.95 , 0.3,
        0.95 , 0.35,
        0.9 , 0.35,
        0.9 , 0.35,
        0.95 , 0.35,
        0.95 , 0.4,
        0.9 , 0.4,
        0.9 , 0.4,
        0.95 , 0.4,
        0.95 , 0.45,
        0.9 , 0.45,
        0.9 , 0.45,
        0.95 , 0.45,
        0.95 , 0.5,
        0.9 , 0.5,
        0.9 , 0.5,
        0.95 , 0.5,
        0.95 , 0.55,
        0.9 , 0.55,
        0.9 , 0.55,
        0.95 , 0.55,
        0.95 , 0.6,
        0.9 , 0.6,
        0.9 , 0.6,
        0.95 , 0.6,
        0.95 , 0.65,
        0.9 , 0.65,
        0.9 , 0.65,
        0.95 , 0.65,
        0.95 , 0.7,
        0.9 , 0.7,
        0.9 , 0.7,
        0.95 , 0.7,
        0.95 , 0.75,
        0.9 , 0.75,
        0.9 , 0.75,
        0.95 , 0.75,
        0.95 , 0.8,
        0.9 , 0.8,
        0.9 , 0.8,
        0.95 , 0.8,
        0.95 , 0.85,
        0.9 , 0.85,
        0.9 , 0.85,
        0.95 , 0.85,
        0.95 , 0.9,
        0.9 , 0.9,
        0.9 , 0.9,
        0.95 , 0.9,
        0.95 , 0.95,
        0.9 , 0.95,
        0.9 , 0.95,
        0.95 , 0.95,
        0.95 , 1,
        0.9 , 1,
        0.95 , 0,
        1 , 0,
        1 , 0.05,
        0.95 , 0.05,
        0.95 , 0.05,
        1 , 0.05,
        1 , 0.1,
        0.95 , 0.1,
        0.95 , 0.1,
        1 , 0.1,
        1 , 0.15,
        0.95 , 0.15,
        0.95 , 0.15,
        1 , 0.15,
        1 , 0.2,
        0.95 , 0.2,
        0.95 , 0.2,
        1 , 0.2,
        1 , 0.25,
        0.95 , 0.25,
        0.95 , 0.25,
        1 , 0.25,
        1 , 0.3,
        0.95 , 0.3,
        0.95 , 0.3,
        1 , 0.3,
        1 , 0.35,
        0.95 , 0.35,
        0.95 , 0.35,
        1 , 0.35,
        1 , 0.4,
        0.95 , 0.4,
        0.95 , 0.4,
        1 , 0.4,
        1 , 0.45,
        0.95 , 0.45,
        0.95 , 0.45,
        1 , 0.45,
        1 , 0.5,
        0.95 , 0.5,
        0.95 , 0.5,
        1 , 0.5,
        1 , 0.55,
        0.95 , 0.55,
        0.95 , 0.55,
        1 , 0.55,
        1 , 0.6,
        0.95 , 0.6,
        0.95 , 0.6,
        1 , 0.6,
        1 , 0.65,
        0.95 , 0.65,
        0.95 , 0.65,
        1 , 0.65,
        1 , 0.7,
        0.95 , 0.7,
        0.95 , 0.7,
        1 , 0.7,
        1 , 0.75,
        0.95 , 0.75,
        0.95 , 0.75,
        1 , 0.75,
        1 , 0.8,
        0.95 , 0.8,
        0.95 , 0.8,
        1 , 0.8,
        1 , 0.85,
        0.95 , 0.85,
        0.95 , 0.85,
        1 , 0.85,
        1 , 0.9,
        0.95 , 0.9,
        0.95 , 0.9,
        1 , 0.9,
        1 , 0.95,
        0.95 , 0.95,
        0.95 , 0.95,
        1 , 0.95,
        1 , 1,
        0.95 , 1

    };
    static  float vertexPositions[3200] ={
        -1 , -1 ,
        -0.9 , -1 ,
        -0.88 , -0.9 ,
        -1 , -0.9 ,
        -1 , -0.9 ,
        -0.88 , -0.9 ,
        -0.86 , -0.8 ,
        -1 , -0.8 ,
        -1 , -0.8 ,
        -0.86 , -0.8 ,
        -0.846667 , -0.7 ,
        -1 , -0.7 ,
        -1 , -0.7 ,
        -0.846667 , -0.7 ,
        -0.84 , -0.6 ,
        -1 , -0.6 ,
        -1 , -0.6 ,
        -0.84 , -0.6 ,
        -0.833333 , -0.5 ,
        -1 , -0.5 ,
        -1 , -0.5 ,
        -0.833333 , -0.5 ,
        -0.826667 , -0.4 ,
        -1 , -0.4 ,
        -1 , -0.4 ,
        -0.826667 , -0.4 ,
        -0.826667 , -0.306667 ,
        -1 , -0.306667 ,
        -1 , -0.306667 ,
        -0.826667 , -0.306667 ,
        -0.826667 , -0.2 ,
        -1 , -0.2 ,
        -1 , -0.2 ,
        -0.826667 , -0.2 ,
        -0.833333 , -0.106667 ,
        -1 , -0.106667 ,
        -1 , -0.106667 ,
        -0.833333 , -0.106667 ,
        -0.84 , 0 ,
        -1 , 0 ,
        -1 , 0 ,
        -0.84 , 0 ,
        -0.853333 , 0.1 ,
        -1 , 0.1 ,
        -1 , 0.1 ,
        -0.853333 , 0.1 ,
        -0.86 , 0.2 ,
        -1 , 0.2 ,
        -1 , 0.2 ,
        -0.86 , 0.2 ,
        -0.86 , 0.293333 ,
        -1 , 0.293333 ,
        -1 , 0.293333 ,
        -0.86 , 0.293333 ,
        -0.873333 , 0.393333 ,
        -1 , 0.393333 ,
        -1 , 0.393333 ,
        -0.873333 , 0.393333 ,
        -0.88 , 0.5 ,
        -1 , 0.5 ,
        -1 , 0.5 ,
        -0.88 , 0.5 ,
        -0.886667 , 0.6 ,
        -1 , 0.6 ,
        -1 , 0.6 ,
        -0.886667 , 0.6 ,
        -0.893333 , 0.7 ,
        -1 , 0.7 ,
        -1 , 0.7 ,
        -0.893333 , 0.7 ,
        -0.893333 , 0.793333 ,
        -1 , 0.793333 ,
        -1 , 0.793333 ,
        -0.893333 , 0.793333 ,
        -0.9 , 0.893333 ,
        -1 , 0.893333 ,
        -1 , 0.893333 ,
        -0.9 , 0.893333 ,
        -0.9 , 1 ,
        -1 , 1 ,
        -0.9 , -1 ,
        -0.8 , -1 ,
        -0.76 , -0.9 ,
        -0.88 , -0.9 ,
        -0.88 , -0.9 ,
        -0.76 , -0.9 ,
        -0.726667 , -0.8 ,
        -0.86 , -0.8 ,
        -0.86 , -0.8 ,
        -0.726667 , -0.8 ,
        -0.706667 , -0.7 ,
        -0.846667 , -0.7 ,
        -0.846667 , -0.7 ,
        -0.706667 , -0.7 ,
        -0.68 , -0.6 ,
        -0.84 , -0.6 ,
        -0.84 , -0.6 ,
        -0.68 , -0.6 ,
        -0.673333 , -0.506667 ,
        -0.833333 , -0.5 ,
        -0.833333 , -0.5 ,
        -0.673333 , -0.506667 ,
        -0.673333 , -0.4 ,
        -0.826667 , -0.4 ,
        -0.826667 , -0.4 ,
        -0.673333 , -0.4 ,
        -0.66 , -0.306667 ,
        -0.826667 , -0.306667 ,
        -0.826667 , -0.306667 ,
        -0.66 , -0.306667 ,
        -0.666667 , -0.2 ,
        -0.826667 , -0.2 ,
        -0.826667 , -0.2 ,
        -0.666667 , -0.2 ,
        -0.68 , -0.106667 ,
        -0.833333 , -0.106667 ,
        -0.833333 , -0.106667 ,
        -0.68 , -0.106667 ,
        -0.686667 , -0.00666667 ,
        -0.84 , 0 ,
        -0.84 , 0 ,
        -0.686667 , -0.00666667 ,
        -0.7 , 0.1 ,
        -0.853333 , 0.1 ,
        -0.853333 , 0.1 ,
        -0.7 , 0.1 ,
        -0.713333 , 0.2 ,
        -0.86 , 0.2 ,
        -0.86 , 0.2 ,
        -0.713333 , 0.2 ,
        -0.733333 , 0.293333 ,
        -0.86 , 0.293333 ,
        -0.86 , 0.293333 ,
        -0.733333 , 0.293333 ,
        -0.733333 , 0.393333 ,
        -0.873333 , 0.393333 ,
        -0.873333 , 0.393333 ,
        -0.733333 , 0.393333 ,
        -0.76 , 0.493333 ,
        -0.88 , 0.5 ,
        -0.88 , 0.5 ,
        -0.76 , 0.493333 ,
        -0.773333 , 0.6 ,
        -0.886667 , 0.6 ,
        -0.886667 , 0.6 ,
        -0.773333 , 0.6 ,
        -0.786667 , 0.7 ,
        -0.893333 , 0.7 ,
        -0.893333 , 0.7 ,
        -0.786667 , 0.7 ,
        -0.793333 , 0.793333 ,
        -0.893333 , 0.793333 ,
        -0.893333 , 0.793333 ,
        -0.793333 , 0.793333 ,
        -0.8 , 0.893333 ,
        -0.9 , 0.893333 ,
        -0.9 , 0.893333 ,
        -0.8 , 0.893333 ,
        -0.806667 , 0.993333 ,
        -0.9 , 1 ,
        -0.8 , -1 ,
        -0.7 , -1 ,
        -0.646667 , -0.9 ,
        -0.76 , -0.9 ,
        -0.76 , -0.9 ,
        -0.646667 , -0.9 ,
        -0.6 , -0.8 ,
        -0.726667 , -0.8 ,
        -0.726667 , -0.8 ,
        -0.6 , -0.8 ,
        -0.566667 , -0.7 ,
        -0.706667 , -0.7 ,
        -0.706667 , -0.7 ,
        -0.566667 , -0.7 ,
        -0.54 , -0.6 ,
        -0.68 , -0.6 ,
        -0.68 , -0.6 ,
        -0.54 , -0.6 ,
        -0.526667 , -0.5 ,
        -0.673333 , -0.506667 ,
        -0.673333 , -0.506667 ,
        -0.526667 , -0.5 ,
        -0.52 , -0.4 ,
        -0.673333 , -0.4 ,
        -0.673333 , -0.4 ,
        -0.52 , -0.4 ,
        -0.513333 , -0.306667 ,
        -0.66 , -0.306667 ,
        -0.66 , -0.306667 ,
        -0.513333 , -0.306667 ,
        -0.52 , -0.2 ,
        -0.666667 , -0.2 ,
        -0.666667 , -0.2 ,
        -0.52 , -0.2 ,
        -0.54 , -0.106667 ,
        -0.68 , -0.106667 ,
        -0.68 , -0.106667 ,
        -0.54 , -0.106667 ,
        -0.546667 , 0 ,
        -0.686667 , -0.00666667 ,
        -0.686667 , -0.00666667 ,
        -0.546667 , 0 ,
        -0.566667 , 0.1 ,
        -0.7 , 0.1 ,
        -0.7 , 0.1 ,
        -0.566667 , 0.1 ,
        -0.58 , 0.2 ,
        -0.713333 , 0.2 ,
        -0.713333 , 0.2 ,
        -0.58 , 0.2 ,
        -0.606667 , 0.293333 ,
        -0.733333 , 0.293333 ,
        -0.733333 , 0.293333 ,
        -0.606667 , 0.293333 ,
        -0.626667 , 0.393333 ,
        -0.733333 , 0.393333 ,
        -0.733333 , 0.393333 ,
        -0.626667 , 0.393333 ,
        -0.64 , 0.5 ,
        -0.76 , 0.493333 ,
        -0.76 , 0.493333 ,
        -0.64 , 0.5 ,
        -0.66 , 0.6 ,
        -0.773333 , 0.6 ,
        -0.773333 , 0.6 ,
        -0.66 , 0.6 ,
        -0.68 , 0.7 ,
        -0.786667 , 0.7 ,
        -0.786667 , 0.7 ,
        -0.68 , 0.7 ,
        -0.693333 , 0.793333 ,
        -0.793333 , 0.793333 ,
        -0.793333 , 0.793333 ,
        -0.693333 , 0.793333 ,
        -0.7 , 0.893333 ,
        -0.8 , 0.893333 ,
        -0.8 , 0.893333 ,
        -0.7 , 0.893333 ,
        -0.7 , 1 ,
        -0.806667 , 0.993333 ,
        -0.7 , -1 ,
        -0.6 , -1 ,
        -0.54 , -0.9 ,
        -0.646667 , -0.9 ,
        -0.646667 , -0.9 ,
        -0.54 , -0.9 ,
        -0.48 , -0.8 ,
        -0.6 , -0.8 ,
        -0.6 , -0.8 ,
        -0.48 , -0.8 ,
        -0.446667 , -0.7 ,
        -0.566667 , -0.7 ,
        -0.566667 , -0.7 ,
        -0.446667 , -0.7 ,
        -0.413333 , -0.6 ,
        -0.54 , -0.6 ,
        -0.54 , -0.6 ,
        -0.413333 , -0.6 ,
        -0.393333 , -0.5 ,
        -0.526667 , -0.5 ,
        -0.526667 , -0.5 ,
        -0.393333 , -0.5 ,
        -0.38 , -0.4 ,
        -0.52 , -0.4 ,
        -0.52 , -0.4 ,
        -0.38 , -0.4 ,
        -0.386667 , -0.306667 ,
        -0.513333 , -0.306667 ,
        -0.513333 , -0.306667 ,
        -0.386667 , -0.306667 ,
        -0.386667 , -0.206667 ,
        -0.52 , -0.2 ,
        -0.52 , -0.2 ,
        -0.386667 , -0.206667 ,
        -0.406667 , -0.106667 ,
        -0.54 , -0.106667 ,
        -0.54 , -0.106667 ,
        -0.406667 , -0.106667 ,
        -0.42 , 0 ,
        -0.546667 , 0 ,
        -0.546667 , 0 ,
        -0.42 , 0 ,
        -0.44 , 0.0933333 ,
        -0.566667 , 0.1 ,
        -0.566667 , 0.1 ,
        -0.44 , 0.0933333 ,
        -0.46 , 0.193333 ,
        -0.58 , 0.2 ,
        -0.58 , 0.2 ,
        -0.46 , 0.193333 ,
        -0.486667 , 0.286667 ,
        -0.606667 , 0.293333 ,
        -0.606667 , 0.293333 ,
        -0.486667 , 0.286667 ,
        -0.5 , 0.386667 ,
        -0.626667 , 0.393333 ,
        -0.626667 , 0.393333 ,
        -0.5 , 0.386667 ,
        -0.533333 , 0.493333 ,
        -0.64 , 0.5 ,
        -0.64 , 0.5 ,
        -0.533333 , 0.493333 ,
        -0.553333 , 0.593333 ,
        -0.66 , 0.6 ,
        -0.66 , 0.6 ,
        -0.553333 , 0.593333 ,
        -0.573333 , 0.693333 ,
        -0.68 , 0.7 ,
        -0.68 , 0.7 ,
        -0.573333 , 0.693333 ,
        -0.593333 , 0.786667 ,
        -0.693333 , 0.793333 ,
        -0.693333 , 0.793333 ,
        -0.593333 , 0.786667 ,
        -0.6 , 0.886667 ,
        -0.7 , 0.893333 ,
        -0.7 , 0.893333 ,
        -0.6 , 0.886667 ,
        -0.6 , 0.993333 ,
        -0.7 , 1 ,
        -0.6 , -1 ,
        -0.5 , -1 ,
        -0.433333 , -0.9 ,
        -0.54 , -0.9 ,
        -0.54 , -0.9 ,
        -0.433333 , -0.9 ,
        -0.373333 , -0.8 ,
        -0.48 , -0.8 ,
        -0.48 , -0.8 ,
        -0.373333 , -0.8 ,
        -0.333333 , -0.7 ,
        -0.446667 , -0.7 ,
        -0.446667 , -0.7 ,
        -0.333333 , -0.7 ,
        -0.293333 , -0.6 ,
        -0.413333 , -0.6 ,
        -0.413333 , -0.6 ,
        -0.293333 , -0.6 ,
        -0.273333 , -0.5 ,
        -0.393333 , -0.5 ,
        -0.393333 , -0.5 ,
        -0.273333 , -0.5 ,
        -0.266667 , -0.4 ,
        -0.38 , -0.4 ,
        -0.38 , -0.4 ,
        -0.266667 , -0.4 ,
        -0.266667 , -0.306667 ,
        -0.386667 , -0.306667 ,
        -0.386667 , -0.306667 ,
        -0.266667 , -0.306667 ,
        -0.266667 , -0.2 ,
        -0.386667 , -0.206667 ,
        -0.386667 , -0.206667 ,
        -0.266667 , -0.2 ,
        -0.28 , -0.106667 ,
        -0.406667 , -0.106667 ,
        -0.406667 , -0.106667 ,
        -0.28 , -0.106667 ,
        -0.3 , 0 ,
        -0.42 , 0 ,
        -0.42 , 0 ,
        -0.3 , 0 ,
        -0.32 , 0.1 ,
        -0.44 , 0.0933333 ,
        -0.44 , 0.0933333 ,
        -0.32 , 0.1 ,
        -0.353333 , 0.2 ,
        -0.46 , 0.193333 ,
        -0.46 , 0.193333 ,
        -0.353333 , 0.2 ,
        -0.373333 , 0.293333 ,
        -0.486667 , 0.286667 ,
        -0.486667 , 0.286667 ,
        -0.373333 , 0.293333 ,
        -0.406667 , 0.393333 ,
        -0.5 , 0.386667 ,
        -0.5 , 0.386667 ,
        -0.406667 , 0.393333 ,
        -0.426667 , 0.5 ,
        -0.533333 , 0.493333 ,
        -0.533333 , 0.493333 ,
        -0.426667 , 0.5 ,
        -0.453333 , 0.6 ,
        -0.553333 , 0.593333 ,
        -0.553333 , 0.593333 ,
        -0.453333 , 0.6 ,
        -0.466667 , 0.7 ,
        -0.573333 , 0.693333 ,
        -0.573333 , 0.693333 ,
        -0.466667 , 0.7 ,
        -0.493333 , 0.793333 ,
        -0.593333 , 0.786667 ,
        -0.593333 , 0.786667 ,
        -0.493333 , 0.793333 ,
        -0.493333 , 0.893333 ,
        -0.6 , 0.886667 ,
        -0.6 , 0.886667 ,
        -0.493333 , 0.893333 ,
        -0.5 , 1 ,
        -0.6 , 0.993333 ,
        -0.5 , -1 ,
        -0.4 , -1 ,
        -0.326667 , -0.9 ,
        -0.433333 , -0.9 ,
        -0.433333 , -0.9 ,
        -0.326667 , -0.9 ,
        -0.266667 , -0.8 ,
        -0.373333 , -0.8 ,
        -0.373333 , -0.8 ,
        -0.266667 , -0.8 ,
        -0.22 , -0.7 ,
        -0.333333 , -0.7 ,
        -0.333333 , -0.7 ,
        -0.22 , -0.7 ,
        -0.186667 , -0.6 ,
        -0.293333 , -0.6 ,
        -0.293333 , -0.6 ,
        -0.186667 , -0.6 ,
        -0.16 , -0.5 ,
        -0.273333 , -0.5 ,
        -0.273333 , -0.5 ,
        -0.16 , -0.5 ,
        -0.146667 , -0.4 ,
        -0.266667 , -0.4 ,
        -0.266667 , -0.4 ,
        -0.146667 , -0.4 ,
        -0.146667 , -0.306667 ,
        -0.266667 , -0.306667 ,
        -0.266667 , -0.306667 ,
        -0.146667 , -0.306667 ,
        -0.16 , -0.2 ,
        -0.266667 , -0.2 ,
        -0.266667 , -0.2 ,
        -0.16 , -0.2 ,
        -0.166667 , -0.106667 ,
        -0.28 , -0.106667 ,
        -0.28 , -0.106667 ,
        -0.166667 , -0.106667 ,
        -0.186667 , 0 ,
        -0.3 , 0 ,
        -0.3 , 0 ,
        -0.186667 , 0 ,
        -0.213333 , 0.1 ,
        -0.32 , 0.1 ,
        -0.32 , 0.1 ,
        -0.213333 , 0.1 ,
        -0.24 , 0.2 ,
        -0.353333 , 0.2 ,
        -0.353333 , 0.2 ,
        -0.24 , 0.2 ,
        -0.273333 , 0.293333 ,
        -0.373333 , 0.293333 ,
        -0.373333 , 0.293333 ,
        -0.273333 , 0.293333 ,
        -0.3 , 0.393333 ,
        -0.406667 , 0.393333 ,
        -0.406667 , 0.393333 ,
        -0.3 , 0.393333 ,
        -0.32 , 0.5 ,
        -0.426667 , 0.5 ,
        -0.426667 , 0.5 ,
        -0.32 , 0.5 ,
        -0.346667 , 0.6 ,
        -0.453333 , 0.6 ,
        -0.453333 , 0.6 ,
        -0.346667 , 0.6 ,
        -0.373333 , 0.7 ,
        -0.466667 , 0.7 ,
        -0.466667 , 0.7 ,
        -0.373333 , 0.7 ,
        -0.386667 , 0.793333 ,
        -0.493333 , 0.793333 ,
        -0.493333 , 0.793333 ,
        -0.386667 , 0.793333 ,
        -0.4 , 0.893333 ,
        -0.493333 , 0.893333 ,
        -0.493333 , 0.893333 ,
        -0.4 , 0.893333 ,
        -0.406667 , 1 ,
        -0.5 , 1 ,
        -0.4 , -1 ,
        -0.306667 , -1 ,
        -0.233333 , -0.9 ,
        -0.326667 , -0.9 ,
        -0.326667 , -0.9 ,
        -0.233333 , -0.9 ,
        -0.173333 , -0.8 ,
        -0.266667 , -0.8 ,
        -0.266667 , -0.8 ,
        -0.173333 , -0.8 ,
        -0.126667 , -0.7 ,
        -0.22 , -0.7 ,
        -0.22 , -0.7 ,
        -0.126667 , -0.7 ,
        -0.0866667 , -0.6 ,
        -0.186667 , -0.6 ,
        -0.186667 , -0.6 ,
        -0.0866667 , -0.6 ,
        -0.0666667 , -0.5 ,
        -0.16 , -0.5 ,
        -0.16 , -0.5 ,
        -0.0666667 , -0.5 ,
        -0.0533333 , -0.4 ,
        -0.146667 , -0.4 ,
        -0.146667 , -0.4 ,
        -0.0533333 , -0.4 ,
        -0.0533333 , -0.306667 ,
        -0.146667 , -0.306667 ,
        -0.146667 , -0.306667 ,
        -0.0533333 , -0.306667 ,
        -0.06 , -0.2 ,
        -0.16 , -0.2 ,
        -0.16 , -0.2 ,
        -0.06 , -0.2 ,
        -0.0733333 , -0.106667 ,
        -0.166667 , -0.106667 ,
        -0.166667 , -0.106667 ,
        -0.0733333 , -0.106667 ,
        -0.0933333 , 0 ,
        -0.186667 , 0 ,
        -0.186667 , 0 ,
        -0.0933333 , 0 ,
        -0.12 , 0.1 ,
        -0.213333 , 0.1 ,
        -0.213333 , 0.1 ,
        -0.12 , 0.1 ,
        -0.146667 , 0.2 ,
        -0.24 , 0.2 ,
        -0.24 , 0.2 ,
        -0.146667 , 0.2 ,
        -0.166667 , 0.293333 ,
        -0.273333 , 0.293333 ,
        -0.273333 , 0.293333 ,
        -0.166667 , 0.293333 ,
        -0.2 , 0.393333 ,
        -0.3 , 0.393333 ,
        -0.3 , 0.393333 ,
        -0.2 , 0.393333 ,
        -0.233333 , 0.5 ,
        -0.32 , 0.5 ,
        -0.32 , 0.5 ,
        -0.233333 , 0.5 ,
        -0.253333 , 0.6 ,
        -0.346667 , 0.6 ,
        -0.346667 , 0.6 ,
        -0.253333 , 0.6 ,
        -0.273333 , 0.7 ,
        -0.373333 , 0.7 ,
        -0.373333 , 0.7 ,
        -0.273333 , 0.7 ,
        -0.293333 , 0.793333 ,
        -0.386667 , 0.793333 ,
        -0.386667 , 0.793333 ,
        -0.293333 , 0.793333 ,
        -0.306667 , 0.893333 ,
        -0.4 , 0.893333 ,
        -0.4 , 0.893333 ,
        -0.306667 , 0.893333 ,
        -0.306667 , 1 ,
        -0.406667 , 1 ,
        -0.306667 , -1 ,
        -0.2 , -1 ,
        -0.133333 , -0.9 ,
        -0.233333 , -0.9 ,
        -0.233333 , -0.9 ,
        -0.133333 , -0.9 ,
        -0.0733333 , -0.8 ,
        -0.173333 , -0.8 ,
        -0.173333 , -0.8 ,
        -0.0733333 , -0.8 ,
        -0.0266667 , -0.7 ,
        -0.126667 , -0.7 ,
        -0.126667 , -0.7 ,
        -0.0266667 , -0.7 ,
        0.0133333 , -0.6 ,
        -0.0866667 , -0.6 ,
        -0.0866667 , -0.6 ,
        0.0133333 , -0.6 ,
        0.0333333 , -0.5 ,
        -0.0666667 , -0.5 ,
        -0.0666667 , -0.5 ,
        0.0333333 , -0.5 ,
        0.04 , -0.4 ,
        -0.0533333 , -0.4 ,
        -0.0533333 , -0.4 ,
        0.04 , -0.4 ,
        0.0466667 , -0.306667 ,
        -0.0533333 , -0.306667 ,
        -0.0533333 , -0.306667 ,
        0.0466667 , -0.306667 ,
        0.04 , -0.2 ,
        -0.06 , -0.2 ,
        -0.06 , -0.2 ,
        0.04 , -0.2 ,
        0.0266667 , -0.106667 ,
        -0.0733333 , -0.106667 ,
        -0.0733333 , -0.106667 ,
        0.0266667 , -0.106667 ,
        0.00666667 , 0 ,
        -0.0933333 , 0 ,
        -0.0933333 , 0 ,
        0.00666667 , 0 ,
        -0.0133333 , 0.1 ,
        -0.12 , 0.1 ,
        -0.12 , 0.1 ,
        -0.0133333 , 0.1 ,
        -0.0466667 , 0.2 ,
        -0.146667 , 0.2 ,
        -0.146667 , 0.2 ,
        -0.0466667 , 0.2 ,
        -0.0733333 , 0.286667 ,
        -0.166667 , 0.293333 ,
        -0.166667 , 0.293333 ,
        -0.0733333 , 0.286667 ,
        -0.106667 , 0.386667 ,
        -0.2 , 0.393333 ,
        -0.2 , 0.393333 ,
        -0.106667 , 0.386667 ,
        -0.126667 , 0.493333 ,
        -0.233333 , 0.5 ,
        -0.233333 , 0.5 ,
        -0.126667 , 0.493333 ,
        -0.146667 , 0.593333 ,
        -0.253333 , 0.6 ,
        -0.253333 , 0.6 ,
        -0.146667 , 0.593333 ,
        -0.166667 , 0.693333 ,
        -0.273333 , 0.7 ,
        -0.273333 , 0.7 ,
        -0.166667 , 0.693333 ,
        -0.186667 , 0.786667 ,
        -0.293333 , 0.793333 ,
        -0.293333 , 0.793333 ,
        -0.186667 , 0.786667 ,
        -0.193333 , 0.886667 ,
        -0.306667 , 0.893333 ,
        -0.306667 , 0.893333 ,
        -0.193333 , 0.886667 ,
        -0.2 , 0.993333 ,
        -0.306667 , 1 ,
        -0.2 , -1 ,
        -0.106667 , -1 ,
        -0.04 , -0.9 ,
        -0.133333 , -0.9 ,
        -0.133333 , -0.9 ,
        -0.04 , -0.9 ,
        0.02 , -0.8 ,
        -0.0733333 , -0.8 ,
        -0.0733333 , -0.8 ,
        0.02 , -0.8 ,
        0.0533333 , -0.7 ,
        -0.0266667 , -0.7 ,
        -0.0266667 , -0.7 ,
        0.0533333 , -0.7 ,
        0.0933333 , -0.6 ,
        0.0133333 , -0.6 ,
        0.0133333 , -0.6 ,
        0.0933333 , -0.6 ,
        0.113333 , -0.5 ,
        0.0333333 , -0.5 ,
        0.0333333 , -0.5 ,
        0.113333 , -0.5 ,
        0.12 , -0.4 ,
        0.04 , -0.4 ,
        0.04 , -0.4 ,
        0.12 , -0.4 ,
        0.12 , -0.306667 ,
        0.0466667 , -0.306667 ,
        0.0466667 , -0.306667 ,
        0.12 , -0.306667 ,
        0.12 , -0.2 ,
        0.04 , -0.2 ,
        0.04 , -0.2 ,
        0.12 , -0.2 ,
        0.106667 , -0.106667 ,
        0.0266667 , -0.106667 ,
        0.0266667 , -0.106667 ,
        0.106667 , -0.106667 ,
        0.0866667 , 0 ,
        0.00666667 , 0 ,
        0.00666667 , 0 ,
        0.0866667 , 0 ,
        0.06 , 0.1 ,
        -0.0133333 , 0.1 ,
        -0.0133333 , 0.1 ,
        0.06 , 0.1 ,
        0.04 , 0.2 ,
        -0.0466667 , 0.2 ,
        -0.0466667 , 0.2 ,
        0.04 , 0.2 ,
        0.0133333 , 0.293333 ,
        -0.0733333 , 0.286667 ,
        -0.0733333 , 0.286667 ,
        0.0133333 , 0.293333 ,
        -0.0133333 , 0.393333 ,
        -0.106667 , 0.386667 ,
        -0.106667 , 0.386667 ,
        -0.0133333 , 0.393333 ,
        -0.04 , 0.5 ,
        -0.126667 , 0.493333 ,
        -0.126667 , 0.493333 ,
        -0.04 , 0.5 ,
        -0.06 , 0.6 ,
        -0.146667 , 0.593333 ,
        -0.146667 , 0.593333 ,
        -0.06 , 0.6 ,
        -0.08 , 0.7 ,
        -0.166667 , 0.693333 ,
        -0.166667 , 0.693333 ,
        -0.08 , 0.7 ,
        -0.0933333 , 0.793333 ,
        -0.186667 , 0.786667 ,
        -0.186667 , 0.786667 ,
        -0.0933333 , 0.793333 ,
        -0.106667 , 0.893333 ,
        -0.193333 , 0.886667 ,
        -0.193333 , 0.886667 ,
        -0.106667 , 0.893333 ,
        -0.106667 , 1 ,
        -0.2 , 0.993333 ,
        -0.106667 , -1 ,
        0 , -1 ,
        0.06 , -0.9 ,
        -0.04 , -0.9 ,
        -0.04 , -0.9 ,
        0.06 , -0.9 ,
        0.113333 , -0.8 ,
        0.02 , -0.8 ,
        0.02 , -0.8 ,
        0.113333 , -0.8 ,
        0.146667 , -0.7 ,
        0.0533333 , -0.7 ,
        0.0533333 , -0.7 ,
        0.146667 , -0.7 ,
        0.18 , -0.6 ,
        0.0933333 , -0.6 ,
        0.0933333 , -0.6 ,
        0.18 , -0.6 ,
        0.2 , -0.5 ,
        0.113333 , -0.5 ,
        0.113333 , -0.5 ,
        0.2 , -0.5 ,
        0.213333 , -0.4 ,
        0.12 , -0.4 ,
        0.12 , -0.4 ,
        0.213333 , -0.4 ,
        0.206667 , -0.306667 ,
        0.12 , -0.306667 ,
        0.12 , -0.306667 ,
        0.206667 , -0.306667 ,
        0.206667 , -0.2 ,
        0.12 , -0.2 ,
        0.12 , -0.2 ,
        0.206667 , -0.2 ,
        0.193333 , -0.106667 ,
        0.106667 , -0.106667 ,
        0.106667 , -0.106667 ,
        0.193333 , -0.106667 ,
        0.18 , 0 ,
        0.0866667 , 0 ,
        0.0866667 , 0 ,
        0.18 , 0 ,
        0.153333 , 0.1 ,
        0.06 , 0.1 ,
        0.06 , 0.1 ,
        0.153333 , 0.1 ,
        0.133333 , 0.2 ,
        0.04 , 0.2 ,
        0.04 , 0.2 ,
        0.133333 , 0.2 ,
        0.106667 , 0.293333 ,
        0.0133333 , 0.293333 ,
        0.0133333 , 0.293333 ,
        0.106667 , 0.293333 ,
        0.0866667 , 0.393333 ,
        -0.0133333 , 0.393333 ,
        -0.0133333 , 0.393333 ,
        0.0866667 , 0.393333 ,
        0.0533333 , 0.5 ,
        -0.04 , 0.5 ,
        -0.04 , 0.5 ,
        0.0533333 , 0.5 ,
        0.04 , 0.6 ,
        -0.06 , 0.6 ,
        -0.06 , 0.6 ,
        0.04 , 0.6 ,
        0.02 , 0.7 ,
        -0.08 , 0.7 ,
        -0.08 , 0.7 ,
        0.02 , 0.7 ,
        0.0133333 , 0.793333 ,
        -0.0933333 , 0.793333 ,
        -0.0933333 , 0.793333 ,
        0.0133333 , 0.793333 ,
        -0.00666667 , 0.893333 ,
        -0.106667 , 0.893333 ,
        -0.106667 , 0.893333 ,
        -0.00666667 , 0.893333 ,
        0 , 1 ,
        -0.106667 , 1 ,
        0 , -1 ,
        0.1 , -1 ,
        0.153333 , -0.9 ,
        0.06 , -0.9 ,
        0.06 , -0.9 ,
        0.153333 , -0.9 ,
        0.2 , -0.8 ,
        0.113333 , -0.8 ,
        0.113333 , -0.8 ,
        0.2 , -0.8 ,
        0.233333 , -0.7 ,
        0.146667 , -0.7 ,
        0.146667 , -0.7 ,
        0.233333 , -0.7 ,
        0.26 , -0.6 ,
        0.18 , -0.6 ,
        0.18 , -0.6 ,
        0.26 , -0.6 ,
        0.28 , -0.5 ,
        0.2 , -0.5 ,
        0.2 , -0.5 ,
        0.28 , -0.5 ,
        0.286667 , -0.4 ,
        0.213333 , -0.4 ,
        0.213333 , -0.4 ,
        0.286667 , -0.4 ,
        0.286667 , -0.306667 ,
        0.206667 , -0.306667 ,
        0.206667 , -0.306667 ,
        0.286667 , -0.306667 ,
        0.28 , -0.2 ,
        0.206667 , -0.2 ,
        0.206667 , -0.2 ,
        0.28 , -0.2 ,
        0.273333 , -0.106667 ,
        0.193333 , -0.106667 ,
        0.193333 , -0.106667 ,
        0.273333 , -0.106667 ,
        0.26 , 0 ,
        0.18 , 0 ,
        0.18 , 0 ,
        0.26 , 0 ,
        0.24 , 0.1 ,
        0.153333 , 0.1 ,
        0.153333 , 0.1 ,
        0.24 , 0.1 ,
        0.22 , 0.2 ,
        0.133333 , 0.2 ,
        0.133333 , 0.2 ,
        0.22 , 0.2 ,
        0.2 , 0.293333 ,
        0.106667 , 0.293333 ,
        0.106667 , 0.293333 ,
        0.2 , 0.293333 ,
        0.173333 , 0.393333 ,
        0.0866667 , 0.393333 ,
        0.0866667 , 0.393333 ,
        0.173333 , 0.393333 ,
        0.153333 , 0.5 ,
        0.0533333 , 0.5 ,
        0.0533333 , 0.5 ,
        0.153333 , 0.5 ,
        0.133333 , 0.6 ,
        0.04 , 0.6 ,
        0.04 , 0.6 ,
        0.133333 , 0.6 ,
        0.12 , 0.7 ,
        0.02 , 0.7 ,
        0.02 , 0.7 ,
        0.12 , 0.7 ,
        0.106667 , 0.793333 ,
        0.0133333 , 0.793333 ,
        0.0133333 , 0.793333 ,
        0.106667 , 0.793333 ,
        0.1 , 0.893333 ,
        -0.00666667 , 0.893333 ,
        -0.00666667 , 0.893333 ,
        0.1 , 0.893333 ,
        0.1 , 1 ,
        0 , 1 ,
        0.1 , -1 ,
        0.2 , -1 ,
        0.246667 , -0.9 ,
        0.153333 , -0.9 ,
        0.153333 , -0.9 ,
        0.246667 , -0.9 ,
        0.286667 , -0.8 ,
        0.2 , -0.8 ,
        0.2 , -0.8 ,
        0.286667 , -0.8 ,
        0.313333 , -0.7 ,
        0.233333 , -0.7 ,
        0.233333 , -0.7 ,
        0.313333 , -0.7 ,
        0.34 , -0.6 ,
        0.26 , -0.6 ,
        0.26 , -0.6 ,
        0.34 , -0.6 ,
        0.353333 , -0.5 ,
        0.28 , -0.5 ,
        0.28 , -0.5 ,
        0.353333 , -0.5 ,
        0.353333 , -0.4 ,
        0.286667 , -0.4 ,
        0.286667 , -0.4 ,
        0.353333 , -0.4 ,
        0.36 , -0.306667 ,
        0.286667 , -0.306667 ,
        0.286667 , -0.306667 ,
        0.36 , -0.306667 ,
        0.36 , -0.2 ,
        0.28 , -0.2 ,
        0.28 , -0.2 ,
        0.36 , -0.2 ,
        0.346667 , -0.106667 ,
        0.273333 , -0.106667 ,
        0.273333 , -0.106667 ,
        0.346667 , -0.106667 ,
        0.333333 , 0 ,
        0.26 , 0 ,
        0.26 , 0 ,
        0.333333 , 0 ,
        0.32 , 0.1 ,
        0.24 , 0.1 ,
        0.24 , 0.1 ,
        0.32 , 0.1 ,
        0.3 , 0.2 ,
        0.22 , 0.2 ,
        0.22 , 0.2 ,
        0.3 , 0.2 ,
        0.28 , 0.293333 ,
        0.2 , 0.293333 ,
        0.2 , 0.293333 ,
        0.28 , 0.293333 ,
        0.26 , 0.393333 ,
        0.173333 , 0.393333 ,
        0.173333 , 0.393333 ,
        0.26 , 0.393333 ,
        0.24 , 0.5 ,
        0.153333 , 0.5 ,
        0.153333 , 0.5 ,
        0.24 , 0.5 ,
        0.226667 , 0.6 ,
        0.133333 , 0.6 ,
        0.133333 , 0.6 ,
        0.226667 , 0.6 ,
        0.213333 , 0.7 ,
        0.12 , 0.7 ,
        0.12 , 0.7 ,
        0.213333 , 0.7 ,
        0.2 , 0.793333 ,
        0.106667 , 0.793333 ,
        0.106667 , 0.793333 ,
        0.2 , 0.793333 ,
        0.2 , 0.893333 ,
        0.1 , 0.893333 ,
        0.1 , 0.893333 ,
        0.2 , 0.893333 ,
        0.186667 , 1 ,
        0.1 , 1 ,
        0.2 , -1 ,
        0.293333 , -1 ,
        0.333333 , -0.9 ,
        0.246667 , -0.9 ,
        0.246667 , -0.9 ,
        0.333333 , -0.9 ,
        0.366667 , -0.8 ,
        0.286667 , -0.8 ,
        0.286667 , -0.8 ,
        0.366667 , -0.8 ,
        0.386667 , -0.7 ,
        0.313333 , -0.7 ,
        0.313333 , -0.7 ,
        0.386667 , -0.7 ,
        0.406667 , -0.6 ,
        0.34 , -0.6 ,
        0.34 , -0.6 ,
        0.406667 , -0.6 ,
        0.42 , -0.5 ,
        0.353333 , -0.5 ,
        0.353333 , -0.5 ,
        0.42 , -0.5 ,
        0.42 , -0.4 ,
        0.353333 , -0.4 ,
        0.353333 , -0.4 ,
        0.42 , -0.4 ,
        0.426667 , -0.306667 ,
        0.36 , -0.306667 ,
        0.36 , -0.306667 ,
        0.426667 , -0.306667 ,
        0.426667 , -0.2 ,
        0.36 , -0.2 ,
        0.36 , -0.2 ,
        0.426667 , -0.2 ,
        0.413333 , -0.106667 ,
        0.346667 , -0.106667 ,
        0.346667 , -0.106667 ,
        0.413333 , -0.106667 ,
        0.4 , 0 ,
        0.333333 , 0 ,
        0.333333 , 0 ,
        0.4 , 0 ,
        0.386667 , 0.1 ,
        0.32 , 0.1 ,
        0.32 , 0.1 ,
        0.386667 , 0.1 ,
        0.366667 , 0.2 ,
        0.3 , 0.2 ,
        0.3 , 0.2 ,
        0.366667 , 0.2 ,
        0.36 , 0.293333 ,
        0.28 , 0.293333 ,
        0.28 , 0.293333 ,
        0.36 , 0.293333 ,
        0.346667 , 0.393333 ,
        0.26 , 0.393333 ,
        0.26 , 0.393333 ,
        0.346667 , 0.393333 ,
        0.326667 , 0.5 ,
        0.24 , 0.5 ,
        0.24 , 0.5 ,
        0.326667 , 0.5 ,
        0.313333 , 0.6 ,
        0.226667 , 0.6 ,
        0.226667 , 0.6 ,
        0.313333 , 0.6 ,
        0.3 , 0.7 ,
        0.213333 , 0.7 ,
        0.213333 , 0.7 ,
        0.3 , 0.7 ,
        0.286667 , 0.793333 ,
        0.2 , 0.793333 ,
        0.2 , 0.793333 ,
        0.286667 , 0.793333 ,
        0.286667 , 0.893333 ,
        0.2 , 0.893333 ,
        0.2 , 0.893333 ,
        0.286667 , 0.893333 ,
        0.286667 , 1 ,
        0.186667 , 1 ,
        0.293333 , -1 ,
        0.393333 , -1 ,
        0.42 , -0.9 ,
        0.333333 , -0.9 ,
        0.333333 , -0.9 ,
        0.42 , -0.9 ,
        0.446667 , -0.8 ,
        0.366667 , -0.8 ,
        0.366667 , -0.8 ,
        0.446667 , -0.8 ,
        0.466667 , -0.7 ,
        0.386667 , -0.7 ,
        0.386667 , -0.7 ,
        0.466667 , -0.7 ,
        0.473333 , -0.6 ,
        0.406667 , -0.6 ,
        0.406667 , -0.6 ,
        0.473333 , -0.6 ,
        0.486667 , -0.5 ,
        0.42 , -0.5 ,
        0.42 , -0.5 ,
        0.486667 , -0.5 ,
        0.5 , -0.4 ,
        0.42 , -0.4 ,
        0.42 , -0.4 ,
        0.5 , -0.4 ,
        0.493333 , -0.306667 ,
        0.426667 , -0.306667 ,
        0.426667 , -0.306667 ,
        0.493333 , -0.306667 ,
        0.493333 , -0.2 ,
        0.426667 , -0.2 ,
        0.426667 , -0.2 ,
        0.493333 , -0.2 ,
        0.493333 , -0.106667 ,
        0.413333 , -0.106667 ,
        0.413333 , -0.106667 ,
        0.493333 , -0.106667 ,
        0.48 , 0 ,
        0.4 , 0 ,
        0.4 , 0 ,
        0.48 , 0 ,
        0.466667 , 0.1 ,
        0.386667 , 0.1 ,
        0.386667 , 0.1 ,
        0.466667 , 0.1 ,
        0.46 , 0.2 ,
        0.366667 , 0.2 ,
        0.366667 , 0.2 ,
        0.46 , 0.2 ,
        0.446667 , 0.293333 ,
        0.36 , 0.293333 ,
        0.36 , 0.293333 ,
        0.446667 , 0.293333 ,
        0.426667 , 0.393333 ,
        0.346667 , 0.393333 ,
        0.346667 , 0.393333 ,
        0.426667 , 0.393333 ,
        0.42 , 0.5 ,
        0.326667 , 0.5 ,
        0.326667 , 0.5 ,
        0.42 , 0.5 ,
        0.406667 , 0.6 ,
        0.313333 , 0.6 ,
        0.313333 , 0.6 ,
        0.406667 , 0.6 ,
        0.4 , 0.7 ,
        0.3 , 0.7 ,
        0.3 , 0.7 ,
        0.4 , 0.7 ,
        0.393333 , 0.793333 ,
        0.286667 , 0.793333 ,
        0.286667 , 0.793333 ,
        0.393333 , 0.793333 ,
        0.386667 , 0.893333 ,
        0.286667 , 0.893333 ,
        0.286667 , 0.893333 ,
        0.386667 , 0.893333 ,
        0.386667 , 1 ,
        0.286667 , 1 ,
        0.393333 , -1 ,
        0.5 , -1 ,
        0.52 , -0.9 ,
        0.42 , -0.9 ,
        0.42 , -0.9 ,
        0.52 , -0.9 ,
        0.54 , -0.8 ,
        0.446667 , -0.8 ,
        0.446667 , -0.8 ,
        0.54 , -0.8 ,
        0.553333 , -0.7 ,
        0.466667 , -0.7 ,
        0.466667 , -0.7 ,
        0.553333 , -0.7 ,
        0.56 , -0.6 ,
        0.473333 , -0.6 ,
        0.473333 , -0.6 ,
        0.56 , -0.6 ,
        0.573333 , -0.5 ,
        0.486667 , -0.5 ,
        0.486667 , -0.5 ,
        0.573333 , -0.5 ,
        0.573333 , -0.4 ,
        0.5 , -0.4 ,
        0.5 , -0.4 ,
        0.573333 , -0.4 ,
        0.573333 , -0.306667 ,
        0.493333 , -0.306667 ,
        0.493333 , -0.306667 ,
        0.573333 , -0.306667 ,
        0.566667 , -0.2 ,
        0.493333 , -0.2 ,
        0.493333 , -0.2 ,
        0.566667 , -0.2 ,
        0.56 , -0.106667 ,
        0.493333 , -0.106667 ,
        0.493333 , -0.106667 ,
        0.56 , -0.106667 ,
        0.56 , 0 ,
        0.48 , 0 ,
        0.48 , 0 ,
        0.56 , 0 ,
        0.553333 , 0.1 ,
        0.466667 , 0.1 ,
        0.466667 , 0.1 ,
        0.553333 , 0.1 ,
        0.546667 , 0.2 ,
        0.46 , 0.2 ,
        0.46 , 0.2 ,
        0.546667 , 0.2 ,
        0.533333 , 0.293333 ,
        0.446667 , 0.293333 ,
        0.446667 , 0.293333 ,
        0.533333 , 0.293333 ,
        0.526667 , 0.393333 ,
        0.426667 , 0.393333 ,
        0.426667 , 0.393333 ,
        0.526667 , 0.393333 ,
        0.52 , 0.5 ,
        0.42 , 0.5 ,
        0.42 , 0.5 ,
        0.52 , 0.5 ,
        0.506667 , 0.6 ,
        0.406667 , 0.6 ,
        0.406667 , 0.6 ,
        0.506667 , 0.6 ,
        0.5 , 0.7 ,
        0.4 , 0.7 ,
        0.4 , 0.7 ,
        0.5 , 0.7 ,
        0.493333 , 0.793333 ,
        0.393333 , 0.793333 ,
        0.393333 , 0.793333 ,
        0.493333 , 0.793333 ,
        0.493333 , 0.893333 ,
        0.386667 , 0.893333 ,
        0.386667 , 0.893333 ,
        0.493333 , 0.893333 ,
        0.493333 , 1 ,
        0.386667 , 1 ,
        0.5 , -1 ,
        0.6 , -1 ,
        0.606667 , -0.9 ,
        0.52 , -0.9 ,
        0.52 , -0.9 ,
        0.606667 , -0.9 ,
        0.62 , -0.8 ,
        0.54 , -0.8 ,
        0.54 , -0.8 ,
        0.62 , -0.8 ,
        0.633333 , -0.7 ,
        0.553333 , -0.7 ,
        0.553333 , -0.7 ,
        0.633333 , -0.7 ,
        0.64 , -0.6 ,
        0.56 , -0.6 ,
        0.56 , -0.6 ,
        0.64 , -0.6 ,
        0.64 , -0.5 ,
        0.573333 , -0.5 ,
        0.573333 , -0.5 ,
        0.64 , -0.5 ,
        0.646667 , -0.4 ,
        0.573333 , -0.4 ,
        0.573333 , -0.4 ,
        0.646667 , -0.4 ,
        0.646667 , -0.306667 ,
        0.573333 , -0.306667 ,
        0.573333 , -0.306667 ,
        0.646667 , -0.306667 ,
        0.646667 , -0.2 ,
        0.566667 , -0.2 ,
        0.566667 , -0.2 ,
        0.646667 , -0.2 ,
        0.64 , -0.106667 ,
        0.56 , -0.106667 ,
        0.56 , -0.106667 ,
        0.64 , -0.106667 ,
        0.64 , 0 ,
        0.56 , 0 ,
        0.56 , 0 ,
        0.64 , 0 ,
        0.633333 , 0.1 ,
        0.553333 , 0.1 ,
        0.553333 , 0.1 ,
        0.633333 , 0.1 ,
        0.626667 , 0.2 ,
        0.546667 , 0.2 ,
        0.546667 , 0.2 ,
        0.626667 , 0.2 ,
        0.62 , 0.293333 ,
        0.533333 , 0.293333 ,
        0.533333 , 0.293333 ,
        0.62 , 0.293333 ,
        0.613333 , 0.393333 ,
        0.526667 , 0.393333 ,
        0.526667 , 0.393333 ,
        0.613333 , 0.393333 ,
        0.613333 , 0.5 ,
        0.52 , 0.5 ,
        0.52 , 0.5 ,
        0.613333 , 0.5 ,
        0.606667 , 0.6 ,
        0.506667 , 0.6 ,
        0.506667 , 0.6 ,
        0.606667 , 0.6 ,
        0.593333 , 0.7 ,
        0.5 , 0.7 ,
        0.5 , 0.7 ,
        0.593333 , 0.7 ,
        0.586667 , 0.793333 ,
        0.493333 , 0.793333 ,
        0.493333 , 0.793333 ,
        0.586667 , 0.793333 ,
        0.593333 , 0.893333 ,
        0.493333 , 0.893333 ,
        0.493333 , 0.893333 ,
        0.593333 , 0.893333 ,
        0.586667 , 1 ,
        0.493333 , 1 ,
        0.6 , -1 ,
        0.7 , -1 ,
        0.7 , -0.9 ,
        0.606667 , -0.9 ,
        0.606667 , -0.9 ,
        0.7 , -0.9 ,
        0.713333 , -0.8 ,
        0.62 , -0.8 ,
        0.62 , -0.8 ,
        0.713333 , -0.8 ,
        0.72 , -0.7 ,
        0.633333 , -0.7 ,
        0.633333 , -0.7 ,
        0.72 , -0.7 ,
        0.72 , -0.6 ,
        0.64 , -0.6 ,
        0.64 , -0.6 ,
        0.72 , -0.6 ,
        0.72 , -0.5 ,
        0.64 , -0.5 ,
        0.64 , -0.5 ,
        0.72 , -0.5 ,
        0.72 , -0.4 ,
        0.646667 , -0.4 ,
        0.646667 , -0.4 ,
        0.72 , -0.4 ,
        0.726667 , -0.306667 ,
        0.646667 , -0.306667 ,
        0.646667 , -0.306667 ,
        0.726667 , -0.306667 ,
        0.72 , -0.2 ,
        0.646667 , -0.2 ,
        0.646667 , -0.2 ,
        0.72 , -0.2 ,
        0.726667 , -0.106667 ,
        0.64 , -0.106667 ,
        0.64 , -0.106667 ,
        0.726667 , -0.106667 ,
        0.72 , 0 ,
        0.64 , 0 ,
        0.64 , 0 ,
        0.72 , 0 ,
        0.713333 , 0.1 ,
        0.633333 , 0.1 ,
        0.633333 , 0.1 ,
        0.713333 , 0.1 ,
        0.713333 , 0.2 ,
        0.626667 , 0.2 ,
        0.626667 , 0.2 ,
        0.713333 , 0.2 ,
        0.706667 , 0.293333 ,
        0.62 , 0.293333 ,
        0.62 , 0.293333 ,
        0.706667 , 0.293333 ,
        0.706667 , 0.393333 ,
        0.613333 , 0.393333 ,
        0.613333 , 0.393333 ,
        0.706667 , 0.393333 ,
        0.7 , 0.5 ,
        0.613333 , 0.5 ,
        0.613333 , 0.5 ,
        0.7 , 0.5 ,
        0.693333 , 0.6 ,
        0.606667 , 0.6 ,
        0.606667 , 0.6 ,
        0.693333 , 0.6 ,
        0.7 , 0.7 ,
        0.593333 , 0.7 ,
        0.593333 , 0.7 ,
        0.7 , 0.7 ,
        0.693333 , 0.793333 ,
        0.586667 , 0.793333 ,
        0.586667 , 0.793333 ,
        0.693333 , 0.793333 ,
        0.686667 , 0.893333 ,
        0.593333 , 0.893333 ,
        0.593333 , 0.893333 ,
        0.686667 , 0.893333 ,
        0.693333 , 1 ,
        0.586667 , 1 ,
        0.7 , -1 ,
        0.793333 , -1 ,
        0.786667 , -0.9 ,
        0.7 , -0.9 ,
        0.7 , -0.9 ,
        0.786667 , -0.9 ,
        0.793333 , -0.8 ,
        0.713333 , -0.8 ,
        0.713333 , -0.8 ,
        0.793333 , -0.8 ,
        0.8 , -0.7 ,
        0.72 , -0.7 ,
        0.72 , -0.7 ,
        0.8 , -0.7 ,
        0.8 , -0.6 ,
        0.72 , -0.6 ,
        0.72 , -0.6 ,
        0.8 , -0.6 ,
        0.8 , -0.5 ,
        0.72 , -0.5 ,
        0.72 , -0.5 ,
        0.8 , -0.5 ,
        0.8 , -0.4 ,
        0.72 , -0.4 ,
        0.72 , -0.4 ,
        0.8 , -0.4 ,
        0.8 , -0.306667 ,
        0.726667 , -0.306667 ,
        0.726667 , -0.306667 ,
        0.8 , -0.306667 ,
        0.8 , -0.2 ,
        0.72 , -0.2 ,
        0.72 , -0.2 ,
        0.8 , -0.2 ,
        0.8 , -0.106667 ,
        0.726667 , -0.106667 ,
        0.726667 , -0.106667 ,
        0.8 , -0.106667 ,
        0.8 , 0 ,
        0.72 , 0 ,
        0.72 , 0 ,
        0.8 , 0 ,
        0.793333 , 0.1 ,
        0.713333 , 0.1 ,
        0.713333 , 0.1 ,
        0.793333 , 0.1 ,
        0.793333 , 0.2 ,
        0.713333 , 0.2 ,
        0.713333 , 0.2 ,
        0.793333 , 0.2 ,
        0.793333 , 0.293333 ,
        0.706667 , 0.293333 ,
        0.706667 , 0.293333 ,
        0.793333 , 0.293333 ,
        0.793333 , 0.393333 ,
        0.706667 , 0.393333 ,
        0.706667 , 0.393333 ,
        0.793333 , 0.393333 ,
        0.786667 , 0.5 ,
        0.7 , 0.5 ,
        0.7 , 0.5 ,
        0.786667 , 0.5 ,
        0.786667 , 0.6 ,
        0.693333 , 0.6 ,
        0.693333 , 0.6 ,
        0.786667 , 0.6 ,
        0.78 , 0.7 ,
        0.7 , 0.7 ,
        0.7 , 0.7 ,
        0.78 , 0.7 ,
        0.78 , 0.793333 ,
        0.693333 , 0.793333 ,
        0.693333 , 0.793333 ,
        0.78 , 0.793333 ,
        0.78 , 0.893333 ,
        0.686667 , 0.893333 ,
        0.686667 , 0.893333 ,
        0.78 , 0.893333 ,
        0.786667 , 1 ,
        0.693333 , 1 ,
        0.793333 , -1 ,
        0.893333 , -1 ,
        0.886667 , -0.9 ,
        0.786667 , -0.9 ,
        0.786667 , -0.9 ,
        0.886667 , -0.9 ,
        0.886667 , -0.8 ,
        0.793333 , -0.8 ,
        0.793333 , -0.8 ,
        0.886667 , -0.8 ,
        0.886667 , -0.7 ,
        0.8 , -0.7 ,
        0.8 , -0.7 ,
        0.886667 , -0.7 ,
        0.886667 , -0.6 ,
        0.8 , -0.6 ,
        0.8 , -0.6 ,
        0.886667 , -0.6 ,
        0.893333 , -0.5 ,
        0.8 , -0.5 ,
        0.8 , -0.5 ,
        0.893333 , -0.5 ,
        0.893333 , -0.4 ,
        0.8 , -0.4 ,
        0.8 , -0.4 ,
        0.893333 , -0.4 ,
        0.886667 , -0.306667 ,
        0.8 , -0.306667 ,
        0.8 , -0.306667 ,
        0.886667 , -0.306667 ,
        0.886667 , -0.2 ,
        0.8 , -0.2 ,
        0.8 , -0.2 ,
        0.886667 , -0.2 ,
        0.886667 , -0.106667 ,
        0.8 , -0.106667 ,
        0.8 , -0.106667 ,
        0.886667 , -0.106667 ,
        0.886667 , 0 ,
        0.8 , 0 ,
        0.8 , 0 ,
        0.886667 , 0 ,
        0.886667 , 0.1 ,
        0.793333 , 0.1 ,
        0.793333 , 0.1 ,
        0.886667 , 0.1 ,
        0.88 , 0.2 ,
        0.793333 , 0.2 ,
        0.793333 , 0.2 ,
        0.88 , 0.2 ,
        0.886667 , 0.293333 ,
        0.793333 , 0.293333 ,
        0.793333 , 0.293333 ,
        0.886667 , 0.293333 ,
        0.88 , 0.393333 ,
        0.793333 , 0.393333 ,
        0.793333 , 0.393333 ,
        0.88 , 0.393333 ,
        0.886667 , 0.5 ,
        0.786667 , 0.5 ,
        0.786667 , 0.5 ,
        0.886667 , 0.5 ,
        0.886667 , 0.6 ,
        0.786667 , 0.6 ,
        0.786667 , 0.6 ,
        0.886667 , 0.6 ,
        0.88 , 0.7 ,
        0.78 , 0.7 ,
        0.78 , 0.7 ,
        0.88 , 0.7 ,
        0.886667 , 0.793333 ,
        0.78 , 0.793333 ,
        0.78 , 0.793333 ,
        0.886667 , 0.793333 ,
        0.886667 , 0.893333 ,
        0.78 , 0.893333 ,
        0.78 , 0.893333 ,
        0.886667 , 0.893333 ,
        0.886667 , 1 ,
        0.786667 , 1 ,
        0.893333 , -1 ,
        1 , -1 ,
        1 , -0.9 ,
        0.886667 , -0.9 ,
        0.886667 , -0.9 ,
        1 , -0.9 ,
        1 , -0.8 ,
        0.886667 , -0.8 ,
        0.886667 , -0.8 ,
        1 , -0.8 ,
        1 , -0.7 ,
        0.886667 , -0.7 ,
        0.886667 , -0.7 ,
        1 , -0.7 ,
        1 , -0.6 ,
        0.886667 , -0.6 ,
        0.886667 , -0.6 ,
        1 , -0.6 ,
        1 , -0.5 ,
        0.893333 , -0.5 ,
        0.893333 , -0.5 ,
        1 , -0.5 ,
        1 , -0.4 ,
        0.893333 , -0.4 ,
        0.893333 , -0.4 ,
        1 , -0.4 ,
        1 , -0.306667 ,
        0.886667 , -0.306667 ,
        0.886667 , -0.306667 ,
        1 , -0.306667 ,
        1 , -0.2 ,
        0.886667 , -0.2 ,
        0.886667 , -0.2 ,
        1 , -0.2 ,
        1 , -0.106667 ,
        0.886667 , -0.106667 ,
        0.886667 , -0.106667 ,
        1 , -0.106667 ,
        1 , 0 ,
        0.886667 , 0 ,
        0.886667 , 0 ,
        1 , 0 ,
        1 , 0.1 ,
        0.886667 , 0.1 ,
        0.886667 , 0.1 ,
        1 , 0.1 ,
        1 , 0.2 ,
        0.88 , 0.2 ,
        0.88 , 0.2 ,
        1 , 0.2 ,
        1 , 0.293333 ,
        0.886667 , 0.293333 ,
        0.886667 , 0.293333 ,
        1 , 0.293333 ,
        1 , 0.393333 ,
        0.88 , 0.393333 ,
        0.88 , 0.393333 ,
        1 , 0.393333 ,
        1 , 0.5 ,
        0.886667 , 0.5 ,
        0.886667 , 0.5 ,
        1 , 0.5 ,
        1 , 0.6 ,
        0.886667 , 0.6 ,
        0.886667 , 0.6 ,
        1 , 0.6 ,
        1 , 0.7 ,
        0.88 , 0.7 ,
        0.88 , 0.7 ,
        1 , 0.7 ,
        1 , 0.793333 ,
        0.886667 , 0.793333 ,
        0.886667 , 0.793333 ,
        1 , 0.793333 ,
        1 , 0.893333 ,
        0.886667 , 0.893333 ,
        0.886667 , 0.893333 ,
        1 , 0.893333 ,
        1 , 1 ,
        0.886667 , 1

    };

    int gridRes = 20;

    QVector<QVector<QPoint>> bezSurfPoints(gridRes + 1 ,QVector<QPoint>(gridRes + 1,QPoint(0,0)));
    for(int i = 0; i <= gridRes; i++) {
        for(int j = 0; j <= gridRes; j++) {

           auto rlt =  bezier(i / float(gridRes)  , j /  float(gridRes));
           float x = rlt.x;
           float y = rlt.y;
        // 左移 width/2 下移 height /2
            x = x * 2  - myimage.width() ;
            y = y * 2 -  myimage.height() ;
           // vertexPositions[i * gridRes * 2 + j * 2 ] = float(x) /myimage.width() ;
           // vertexPositions[i * gridRes * 2 + j * 2 + 1] = float(y) / myimage.height();

           // vertexColors[i * gridRes * 2 + j * 2 ] = float(i) /gridRes  ;
           // vertexColors[i * gridRes * 2 + j * 2 + 1] = float(j) / gridRes;
         bezSurfPoints[i][j] = QPoint(x, y);
        //bezSurfPoints[i][j] = QPoint(i, j);
        }
    }


//    static const float vertexPositions[] = {
//        1.0f, -1.5f,
//       -1.5f, -1.5f,
//       -1.5f,  1.5f,
//        1.5f,  1.5f
//    };

//    static const float vertexColors[] = {
//        1.0f, 0.0f,
//        0.0f, 0.0f,
//        0.0f, 1.0f,
//        1.0f, 1.0f
//    };

    QOpenGLBuffer vertexPositionBuffer(QOpenGLBuffer::VertexBuffer);
    vertexPositionBuffer.create();
    vertexPositionBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexPositionBuffer.bind();
    vertexPositionBuffer.allocate(vertexPositions, 3200 * sizeof(float));

    QOpenGLBuffer vertexColorBuffer(QOpenGLBuffer::VertexBuffer);
    vertexColorBuffer.create();
    vertexColorBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexColorBuffer.bind();
    vertexColorBuffer.allocate(vertexColors, 3200 * sizeof(float));

    QOpenGLShaderProgram program;
    program.addShaderFromSourceCode(QOpenGLShader::Vertex,
                                   "#version 330\r\n"
                                   "in vec2 position;\n"
                                   "in vec2 color;\n"
                                   "out vec2 fragColor;\n"
                                   "void main() {\n"
                                   "    fragColor = color;\n"
                                   "    gl_Position = vec4(position, 0.0, 1.0);\n"
                                   "}\n"
                                   );
    program.addShaderFromSourceCode(QOpenGLShader::Fragment,
                                   "#version 330\r\n"
                                    "out vec4 renders;;\n"
                                   "in vec2 fragColor;\n"
                                   "uniform sampler2D ourTexture;\n"
                                   "void main() {\n"
                                   "    renders = texture(ourTexture, fragColor);\n"
                                   "}\n"
                                   );
    program.link();
    program.bind();

    QOpenGLVertexArrayObject vao;
    vao.create();
    vao.bind();

    vertexPositionBuffer.bind();
    program.enableAttributeArray("position");
    program.setAttributeBuffer("position", GL_FLOAT, 0, 2);

    vertexColorBuffer.bind();
    program.enableAttributeArray("color");
    program.setAttributeBuffer("color", GL_FLOAT, 0, 2);

    QOpenGLTexture texture(QOpenGLTexture::Target2D);
    program.bind();
    {
            texture.create();
            texture.setData(myimage.mirrored());
            texture.setMinMagFilters(QOpenGLTexture::LinearMipMapLinear,QOpenGLTexture::Linear);
            texture.setWrapMode(QOpenGLTexture::DirectionS,QOpenGLTexture::Repeat);
            texture.setWrapMode(QOpenGLTexture::DirectionT,QOpenGLTexture::Repeat);
            texture.bind(0);                                    //将texture绑定到纹理单元0
                  program.setUniformValue("ourTexture", 0);      //让着色采样器ourTexture从纹理单元0中获取纹理数据
              //  openGLContext.functions()->QOpenGLVertexArrayObject::Binder{&VAO};
                  openGLContext.functions()->glDrawArrays(GL_QUADS,0,1600);     //使用以0开始，长度为4的顶点数据来绘制多边形
                  QImage im = fbo.toImage();

                  if (im.save("d://temp//asd.png")){
                     qDebug("Image saved!!");
                  }


    }



//    ==============DRAWING TO THE FBO============

  //  openGLContext.functions()->glActiveTexture(GL_TEXTURE0);
  //  openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);
   // openGLContext.functions()->glClearColor(0.3f, 0.0f, 0.7f, 1.0f);
  //  openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    openGLContext.functions()->glDrawArrays(GL_TRIANGLES, 0, 3);
    //openGLContext.functions()->glDrawArrays(GL_QUADS, 0, 3);
//   =============CLEANUP================== maybe not necessary
    program.disableAttributeArray("position");
    program.disableAttributeArray("color");
    program.release();
    fbo.release();

//    ========SAVE IMAGE===========

    QImage im = fbo.toImage();

    if (im.save("d://temp//asd.png")){
       qDebug("Image saved!!");
    }
}


void trigle5(){

    QImage img("d://temp//people.png");
    QSurfaceFormat surfaceFormat;
    surfaceFormat.setMajorVersion(2);
    surfaceFormat.setMinorVersion(2);

    QOpenGLContext openGLContext;
    openGLContext.setFormat(surfaceFormat);
    openGLContext.create();
    if(!openGLContext.isValid()) qDebug("Unable to create context");

    QOffscreenSurface surface;
    surface.setFormat(surfaceFormat);
    surface.create();
    if(!surface.isValid()) qDebug("Unable to create the Offscreen surface");

    openGLContext.makeCurrent(&surface);

//   Viewport size
    QSize vpSize = QSize(img.width(), img.height());

    QOpenGLFramebufferObjectFormat fboFormat;
    fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
    QOpenGLFramebufferObject fbo(vpSize, fboFormat);
    openGLContext.functions()->glViewport(0,0,vpSize.width(), vpSize.height());





    fbo.bind();

//    ========GEOMEETRY SETUP========

    QImage myimage("d://temp//300.png");


    int width = myimage.width();
    int height = myimage.height();
    B_[0][0] ={0 ,          0 , 0};
    B_[1][0] ={width / 3    ,0 , 0};
    B_[2][0] ={width * 2 / 3 ,    0 , 0};
    B_[3][0] ={width  ,0 , 0};

    B_[0][1] ={0 ,                  height / 3 , 0};
    B_[1][1] ={width   ,         height / 3 , 0};
    B_[2][1] ={width  * 2/  3 ,     height / 3 , 0};
    B_[3][1] ={width ,              height / 3 , 0};


    B_[0][2] ={0 ,                  height * 2 / 3 , 0};
    B_[1][2] ={width / 3 ,          height * 2 / 3 , 0};
    B_[2][2] ={width * 2 / 3 ,      height * 2 / 3 , 0};
    B_[3][2] ={width  ,             height * 2 / 3 , 0};

    B_[0][3] ={0 ,                  height , 0};
    B_[1][3] ={width / 3 ,          height , 0};
    B_[2][3] ={width * 2 / 3 ,      height , 0};
    B_[3][3] ={width  ,             height , 0};


    static  float vertexColors[12800] ={};
    static  float vertexPositions[12800] ={};

    int gridRes = 40;

    QVector<QVector<QPoint>> bezSurfPoints(gridRes + 1 ,QVector<QPoint>(gridRes + 1,QPoint(0,0)));
    for(int i = 0; i <= gridRes; i++) {
        for(int j = 0; j <= gridRes; j++) {

           auto rlt =  bezier(i / float(gridRes)  , j /  float(gridRes));
           float x = rlt.x;
           float y = rlt.y;
        // 左移 width/2 下移 height /2
            x = x * 2  - myimage.width() ;
            y = y * 2 -  myimage.height() ;

              bezSurfPoints[i][j] = QPoint(x, y);

        }
    }


    int index_tex = 0;
    int index_pos = 0;
    for(int i = 0; i < gridRes; i++) {
        for(int j = 0; j < gridRes; j++) {


            vertexPositions[index_pos++] = bezSurfPoints[i][j].x()  / float(width) ;
            vertexPositions[index_pos++] = bezSurfPoints[i][j].y()  / float(height);
            vertexColors[index_tex++] =  (i) * (width /gridRes / float(width));
            vertexColors[index_tex++] = (j) * (height/gridRes) / float(height) ;


            vertexPositions[index_pos++] = bezSurfPoints[i+1][j].x()  / float(width) ;
            vertexPositions[index_pos++] = bezSurfPoints[i+1][j].y()  / float(height);
            vertexColors[index_tex++] =  (i+1) * (width /gridRes / float(width)); ;
            vertexColors[index_tex++] = (j) * (height/gridRes) / float(height) ;


            vertexPositions[index_pos++] = bezSurfPoints[i+1][j+1].x()  / float(width) ;
            vertexPositions[index_pos++] = bezSurfPoints[i+1][j+1].y()  / float(height);
            vertexColors[index_tex++] =  (i+1) * (width /gridRes / float(width)); ;
            vertexColors[index_tex++] = (j+1) * (height/gridRes) / float(height) ;



            vertexPositions[index_pos++] = bezSurfPoints[i][j+1].x()  / float(width) ;
            vertexPositions[index_pos++] = bezSurfPoints[i][j+1].y()  / float(height);
            vertexColors[index_tex++] =  (i) * (width /gridRes / float(width)); ;
            vertexColors[index_tex++] = (j+1) * (height/gridRes) / float(height) ; ;


        }
    }




    QOpenGLBuffer vertexPositionBuffer(QOpenGLBuffer::VertexBuffer);
    vertexPositionBuffer.create();
    vertexPositionBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexPositionBuffer.bind();
    vertexPositionBuffer.allocate(vertexPositions, 12800 * sizeof(float));

    QOpenGLBuffer vertexColorBuffer(QOpenGLBuffer::VertexBuffer);
    vertexColorBuffer.create();
    vertexColorBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexColorBuffer.bind();
    vertexColorBuffer.allocate(vertexColors, 12800 * sizeof(float));

    QOpenGLShaderProgram program;
    program.addShaderFromSourceCode(QOpenGLShader::Vertex,
                                   "#version 330\r\n"
                                   "in vec2 position;\n"
                                   "in vec2 color;\n"
                                   "out vec2 fragColor;\n"
                                   "void main() {\n"
                                   "    fragColor = color;\n"
                                   "    gl_Position = vec4(position, 0.0, 1.0);\n"
                                   "}\n"
                                   );
    program.addShaderFromSourceCode(QOpenGLShader::Fragment,
                                   "#version 330\r\n"
                                    "out vec4 renders;;\n"
                                   "in vec2 fragColor;\n"
                                   "uniform sampler2D ourTexture;\n"
                                   "void main() {\n"
                                   "    renders = texture(ourTexture, fragColor);\n"
                                   "}\n"
                                   );
    program.link();
    program.bind();

    QOpenGLVertexArrayObject vao;
    vao.create();
    vao.bind();

    vertexPositionBuffer.bind();
    program.enableAttributeArray("position");
    program.setAttributeBuffer("position", GL_FLOAT, 0, 2);

    vertexColorBuffer.bind();
    program.enableAttributeArray("color");
    program.setAttributeBuffer("color", GL_FLOAT, 0, 2);

    QOpenGLTexture texture(QOpenGLTexture::Target2D);
    program.bind();
    {
            texture.create();
            texture.setData(myimage.mirrored());
            texture.setMinMagFilters(QOpenGLTexture::LinearMipMapLinear,QOpenGLTexture::Linear);
            texture.setWrapMode(QOpenGLTexture::DirectionS,QOpenGLTexture::Repeat);
            texture.setWrapMode(QOpenGLTexture::DirectionT,QOpenGLTexture::Repeat);
            texture.bind(0);                                    //将texture绑定到纹理单元0
                  program.setUniformValue("ourTexture", 0);      //让着色采样器ourTexture从纹理单元0中获取纹理数据
              //  openGLContext.functions()->QOpenGLVertexArrayObject::Binder{&VAO};
                  openGLContext.functions()->glDrawArrays(GL_QUADS,0,6400);     //使用以0开始，长度为4的顶点数据来绘制多边形
                  QImage im = fbo.toImage();

                  if (im.save("d://temp//asd.png")){
                     qDebug("Image saved!!");
                  }


    }



//    ==============DRAWING TO THE FBO============

  //  openGLContext.functions()->glActiveTexture(GL_TEXTURE0);
  //  openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);
   // openGLContext.functions()->glClearColor(0.3f, 0.0f, 0.7f, 1.0f);
  //  openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    openGLContext.functions()->glDrawArrays(GL_TRIANGLES, 0, 3);
    //openGLContext.functions()->glDrawArrays(GL_QUADS, 0, 3);
//   =============CLEANUP================== maybe not necessary
    program.disableAttributeArray("position");
    program.disableAttributeArray("color");
    program.release();
    fbo.release();

//    ========SAVE IMAGE===========

    QImage im = fbo.toImage();

    if (im.save("d://temp//asd.png")){
       qDebug("Image saved!!");
    }
}


void trigle(){


    QSurfaceFormat surfaceFormat;
    surfaceFormat.setMajorVersion(4);
    surfaceFormat.setMinorVersion(3);

    QOpenGLContext openGLContext;
    openGLContext.setFormat(surfaceFormat);
    openGLContext.create();
    if(!openGLContext.isValid()) qDebug("Unable to create context");

    QOffscreenSurface surface;
    surface.setFormat(surfaceFormat);
    surface.create();
    if(!surface.isValid()) qDebug("Unable to create the Offscreen surface");

    openGLContext.makeCurrent(&surface);

//   Viewport size
    QSize vpSize = QSize(300, 300);

    QOpenGLFramebufferObjectFormat fboFormat;
    fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
    QOpenGLFramebufferObject fbo(vpSize, fboFormat);
    openGLContext.functions()->glViewport(0,0,vpSize.width(), vpSize.height());




        QImage img("d://temp//300.png");

        // Generate a texture ID
        GLuint textureID;
        openGLContext.functions()->glGenTextures(1, &textureID);

        // Bind the texture
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);

        // Set texture parameters (adjust as needed)
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

        // Load the image data into the texture
        openGLContext.functions()->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.width(), img.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());

        // Unbind the texture
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, 0);


    fbo.bind();

//    ========GEOMEETRY SETUP========

    static const float vertexPositions[] = {
        -1.0f, -1.0f,
        -0.0f,  1.0f,
         1.0f, -1.0f,
    };

    static const float vertexColors[] = {
       1.0f, 0.0f, 0.0f,
       0.0f, 1.0f, 0.0f,
       0.0f, 0.0f, 1.0f
    };




    QOpenGLBuffer vertexPositionBuffer(QOpenGLBuffer::VertexBuffer);
    vertexPositionBuffer.create();
    vertexPositionBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexPositionBuffer.bind();
    vertexPositionBuffer.allocate(vertexPositions, 6 * sizeof(float));

    QOpenGLBuffer vertexColorBuffer(QOpenGLBuffer::VertexBuffer);
    vertexColorBuffer.create();
    vertexColorBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
    vertexColorBuffer.bind();
    vertexColorBuffer.allocate(vertexColors, 9 * sizeof(float));

    QOpenGLShaderProgram program;
    program.addShaderFromSourceCode(QOpenGLShader::Vertex,
                                   "#version 330 core\r\n"
                                   "layout (location = 0) in vec3 aPos;\n"
                                   "layout (location = 1) in vec3 aColor;\n"
                                   "layout (location = 2) in vec2 aTexCoord;\n"
                                   "out vec3 ourColor;\n"
                                   "out vec2 TexCoord;\n"
                                   "void main() {\n"
                                   "    gl_Position = vec4(aPos, 1.0);\n"
                                   "    ourColor = aColor;\n"
                                    "   TexCoord = aTexCoord;;\n"
                                   "}\n"
                                   );
    program.addShaderFromSourceCode(QOpenGLShader::Fragment,
                                   "#version 330 core\r\n"
                                   "out vec4 FragColor;\n"
                                   "in vec3 ourColor;\n"
                                    "in vec2 TexCoord;\n"
                                    "uniform sampler2D ourTexture;\n"
                                   "void main() {\n"
                                   "    FragColor = texture(ourTexture, TexCoord);\n"
                                   "}\n"
                                   );
    program.link();
    program.bind();

    QOpenGLVertexArrayObject vao;
    vao.create();
    vao.bind();

    vertexPositionBuffer.bind();
    program.setAttributeBuffer("aPos", GL_FLOAT, 0, 3, sizeof(GLfloat) * 8);
    program.enableAttributeArray("aPos");

    vertexColorBuffer.bind();
    program.enableAttributeArray("color");
    program.setAttributeBuffer("color", GL_FLOAT, 0, 3);

//    ==============DRAWING TO THE FBO============

  //  openGLContext.functions()->glActiveTexture(GL_TEXTURE0);
  //  openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);
   // openGLContext.functions()->glClearColor(0.3f, 0.0f, 0.7f, 1.0f);
  //  openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    openGLContext.functions()->glDrawArrays(GL_TRIANGLES, 0, 3);
    //openGLContext.functions()->glDrawArrays(GL_QUADS, 0, 3);
//   =============CLEANUP================== maybe not necessary
    program.disableAttributeArray("position");
    program.disableAttributeArray("color");
    program.release();
    fbo.release();

//    ========SAVE IMAGE===========

    QImage im = fbo.toImage();

    if (im.save("d://temp//asd.png")){
       qDebug("Image saved!!");
    }
}


void test2(){


    QSurfaceFormat format;
        format.setMajorVersion(4);
        format.setMinorVersion(3);
        QSurfaceFormat::setDefaultFormat(format);

        QOpenGLContext openGLContext;
        openGLContext.create();

         QOffscreenSurface surface;
        surface.create();
        openGLContext.makeCurrent(&surface);


        QOpenGLShaderProgram shaderProgram;

        if(!shaderProgram.addShaderFromSourceFile(QOpenGLShader::Vertex,"d://temp//triangle.vert")){     //添加并编译顶点着色器
            qDebug()<<"ERROR:"<<shaderProgram.log();    //如果编译出错,打印报错信息
        }
        if(!shaderProgram.addShaderFromSourceFile(QOpenGLShader::Fragment,"d://temp//triangle.frag")){   //添加并编译片段着色器
            qDebug()<<"ERROR:"<<shaderProgram.log();    //如果编译出错,打印报错信息
        }
        if(!shaderProgram.link()){                      //链接着色器
            qDebug()<<"ERROR:"<<shaderProgram.log();    //如果链接出错,打印报错信息
        }

        QOpenGLFramebufferObjectFormat fboFormat;
        fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
        QOpenGLFramebufferObject fbo(300, 300, fboFormat);
      //  fbo.bind();
        openGLContext.functions()->glViewport(0, 0, 300, 300);
    openGLContext.functions()->initializeOpenGLFunctions();


    QVector<float> vertices;

    QOpenGLBuffer VBO;
    QOpenGLVertexArrayObject VAO;
    QOpenGLTexture texture(QOpenGLTexture::Target2D);


    QOpenGLVertexArrayObject::Binder{&VAO};

       VBO.create();       //生成VBO对象
       VBO.bind();         //将VBO绑定到当前的顶点缓冲对象（QOpenGLBuffer::VertexBuffer）中

       //将顶点数据分配到VBO中，第一个参数为数据指针，第二个参数为数据的字节长度
       VBO.allocate(vertices.data(),sizeof(float)*vertices.size());
       texture.create();
       texture.setData(QImage("d://temp//300.png").mirrored());
       texture.setMinMagFilters(QOpenGLTexture::LinearMipMapLinear,QOpenGLTexture::Linear);
       texture.setWrapMode(QOpenGLTexture::DirectionS,QOpenGLTexture::Repeat);
       texture.setWrapMode(QOpenGLTexture::DirectionT,QOpenGLTexture::Repeat);

       //设置顶点解析格式，并启用顶点
       shaderProgram.setAttributeBuffer("aPos", GL_FLOAT, 0, 3, sizeof(GLfloat) * 8);
       shaderProgram.enableAttributeArray("aPos");
       shaderProgram.setAttributeBuffer("aColor", GL_FLOAT,sizeof(GLfloat) * 3, 3, sizeof(GLfloat) * 8);
       shaderProgram.enableAttributeArray("aColor");
       shaderProgram.setAttributeBuffer("aTexCoord", GL_FLOAT,sizeof(GLfloat) * 6, 2, sizeof(GLfloat) * 8);
       shaderProgram.enableAttributeArray("aTexCoord");







//        QImage image;
//        if(!image.load("d://temp//300.png")){  // Specify the image file
//            qDebug() << "Failed to load image";
//            return ;
//        }

//        QImage glImage = image.convertToFormat(QImage::Format_RGBA8888);

//        GLuint textureID;
//        openGLContext.functions()->glGenTextures(1, &textureID);
//        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);
//        openGLContext.functions()->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, glImage.width(), glImage.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, glImage.bits());
//        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
//        openGLContext.functions()->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, 0);




        openGLContext.functions()->glClearColor(0.1f,0.5f,0.7f,1.0f);  //设置清屏颜色
        openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT);       //清除颜色缓存
        shaderProgram.bind();                     //使用shaderProgram着色程序
        {
            texture.bind(0);                                    //将texture绑定到纹理单元0
            shaderProgram.setUniformValue("ourTexture",0);      //让着色采样器ourTexture从纹理单元0中获取纹理数据
            QOpenGLVertexArrayObject::Binder{&VAO};
            openGLContext.functions()->glDrawArrays(GL_POLYGON,0,4);     //使用以0开始，长度为4的顶点数据来绘制多边形
        }

        QImage results = fbo.toImage();
        results.save("d://temp//output.png");

        static const float vertexPositions[] = {0.0, 0.0, 0.5, 1.0, 1.0, 0.0};
        static const float vertexTextures[] = {0.0, 0.0, 0.5, 1.0, 1.0, 0.0};

        QOpenGLBuffer vertexPositionBuffer;
        vertexPositionBuffer.create();
        vertexPositionBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
        vertexPositionBuffer.bind();
        vertexPositionBuffer.allocate(vertexPositions, 6 * sizeof(float));

        QOpenGLBuffer vertexTextureBuffer(QOpenGLBuffer::VertexBuffer);
        vertexTextureBuffer.create();
        vertexTextureBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
        vertexTextureBuffer.bind();
        vertexTextureBuffer.allocate(vertexTextures, 6 * sizeof(float));

        QOpenGLShaderProgram program;
        program.addShaderFromSourceCode(QOpenGLShader::Vertex,
                                        "#version 330\n"
                                        "in vec2 position;\n"
                                        "in vec2 texture;\n"
                                        "out vec2 TexCoord;\n"
                                        "void main() {\n"
                                        "    TexCoord = texture;\n"
                                        "    gl_Position = vec4(position, 0.0, 1.0);\n"
                                        "}\n");
        program.addShaderFromSourceCode(QOpenGLShader::Fragment,
                                        "#version 330\n"
                                        "out vec4 FragColor;\n"
                                        "in vec2 TexCoord;\n"
                                        "uniform sampler2D sampleTexture;\n"
                                        "void main() {\n"
                                        "    FragColor = texture(sampleTexture, TexCoord);\n"
                                        "}\n");
        program.link();
        program.bind();

        vertexPositionBuffer.bind();
        program.enableAttributeArray("position");
        program.setAttributeBuffer("position", GL_FLOAT, 0, 2);

        vertexTextureBuffer.bind();
        program.enableAttributeArray("texture");
        program.setAttributeBuffer("texture", GL_FLOAT, 0, 2);


        openGLContext.functions()->glClearColor(0.3f, 0.0f, 0.7f, 1.0f);
        openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
       // openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, textureID);
        openGLContext.functions()->glDrawArrays(GL_TRIANGLES, 0, 3);
        openGLContext.functions()->glBindTexture(GL_TEXTURE_2D, 0);

        QImage result = fbo.toImage();
        result.save("d://temp//output.png");



}













#ifdef WIN64
	#define BEZIER_TRANSFORM
#endif

#ifdef BEZIER_TRANSFORM


#include <QOpenGLTexture>
#include <QOffscreenSurface>
#include <QOpenGLFunctions>
#include <QOpenGLFramebufferObject>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <QOpenGLVertexArrayObject>

struct Vertex3D
{
	double x, y, z;
};
typedef Vertex3D BezierSurfaceBMatrix[4][4];

BezierSurfaceBMatrix B_;

Vertex3D bezier(double u, double v)
{
	double u2 = u * u;
	double u3 = u2 * u;
	double v2 = v * v;
	double v3 = v2 * v;

	double U[4] = { 1, u, u2, u3 };
	double V[4] = { 1, v, v2, v3 };

	static const double M[4][4] = {
					   { 1, 0, 0, 0},
					   {-3, 3, 0, 0},
					   { 3,-6, 3, 0},
					   {-1, 3,-3, 1},
	};
	//UM
	double UM[4] = { 0 };
	for (int i = 0; i < 4; i++)
		for (int j = 0; j < 4; j++)
			UM[i] += U[j] * M[j][i];

	//UMB
	double UMBx[4] = { 0 };
	double UMBy[4] = { 0 };
	double UMBz[4] = { 0 };
	for (int i = 0; i < 4; i++)
		for (int j = 0; j < 4; j++)
		{
			UMBx[i] += UM[j] * B_[j][i].x;
			UMBy[i] += UM[j] * B_[j][i].y;
			UMBz[i] += UM[j] * B_[j][i].z;
		}

	//UMB(M^T)
	double UMBMtx[4] = { 0 };
	double UMBMty[4] = { 0 };
	double UMBMtz[4] = { 0 };
	for (int i = 0; i < 4; i++)
		for (int j = 0; j < 4; j++)
		{
			UMBMtx[i] += UMBx[j] * M[i][j];
			UMBMty[i] += UMBy[j] * M[i][j];
			UMBMtz[i] += UMBz[j] * M[i][j];
		}

	//UMB(M^T)V
	Vertex3D res = { 0,0,0 };
	for (int i = 0; i < 4; i++)
	{
		res.x += UMBMtx[i] * V[i];
		res.y += UMBMty[i] * V[i];
		res.z += UMBMtz[i] * V[i];
	}

	return res;
}

#endif

bool bezierTransform(QImage& image, QVector<QVector<QPointF>> control_point) {
#ifdef BEZIER_TRANSFORM
	if (control_point.size() < 1) {
		return false;
	}
	normFormat(image);
	QImage myimage = image;
	QSurfaceFormat surfaceFormat;
	surfaceFormat.setMajorVersion(2);
	surfaceFormat.setMinorVersion(2);

	QOpenGLContext openGLContext;
	openGLContext.setFormat(surfaceFormat);
	openGLContext.create();
	if (!openGLContext.isValid()) {
		qDebug("Unable to create context");
		return false;
	}

	QOffscreenSurface surface;
	surface.setFormat(surfaceFormat);
	surface.create();
	if (!surface.isValid()) {
		qDebug("Unable to create the Offscreen surface");
		return false;
	}

	openGLContext.makeCurrent(&surface);

	//   Viewport size
	QSize vpSize = QSize(myimage.width(), myimage.height());

	QOpenGLFramebufferObjectFormat fboFormat;
	fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
	QOpenGLFramebufferObject fbo(vpSize, fboFormat);
	openGLContext.functions()->glViewport(0, 0, vpSize.width(), vpSize.height());


	fbo.bind();

	int width = myimage.width();
	int height = myimage.height();


	//B_[0][0] = { 0 ,          0 , 0 };
	//B_[1][0] = { width / 3    ,0 , 0 };
	//B_[2][0] = { width * 2 / 3 ,    0 , 0 };
	//B_[3][0] = { width   , 0  , 0 };

	//B_[0][1] = { 0 ,                  height / 3 , 0 };
	//B_[1][1] = { width   ,         height / 3 , 0 };
	//B_[2][1] = { width * 2 / 3 ,     height / 3 , 0 };
	//B_[3][1] = { width ,              height / 3 , 0 };


	//B_[0][2] = { 0 ,                  height * 2 / 3 , 0 };
	//B_[1][2] = { width / 3 ,          height * 2 / 3 , 0 };
	//B_[2][2] = { width * 2 / 3 ,      height * 2 / 3 , 0 };
	//B_[3][2] = { width  ,             height * 2 / 3 , 0 };

	//B_[0][3] = { 0 ,                  height , 0 };
	//B_[1][3] = { width / 3 ,          height , 0 };
	//B_[2][3] = { width * 2 / 3 ,      height , 0 };
	////B_[3][3] = { width  ,             height , 0 };
	//B_[3][3] = { 0  ,             0 , 0 };



	B_[0][0] = { control_point[0][0].x() ,  control_point[0][0].y() , 0 };
	B_[1][0] = { control_point[0][1].x() ,  control_point[0][1].y() , 0 };
	B_[2][0] = { control_point[0][2].x() ,  control_point[0][2].y() , 0 };
	B_[3][0] = { control_point[0][3].x() ,  control_point[0][3].y() , 0 };

	B_[0][1] = { control_point[0][4].x() ,  control_point[0][4].y() , 0 };
	B_[1][1] = { control_point[0][5].x() ,  control_point[0][5].y() , 0 };
	B_[2][1] = { control_point[0][6].x() ,  control_point[0][6].y() , 0 };
	B_[3][1] = { control_point[0][7].x() ,  control_point[0][7].y() , 0 };


	B_[0][2] = { control_point[0][8].x() ,  control_point[0][8].y() , 0 };
	B_[1][2] = { control_point[0][9].x() ,  control_point[0][9].y() , 0 };
	B_[2][2] = { control_point[0][10].x() ,  control_point[0][10].y() , 0 };
	B_[3][2] = { control_point[0][11].x() ,  control_point[0][11].y() , 0 };

	B_[0][3] = { control_point[0][12].x() ,  control_point[0][12].y() , 0 };
	B_[1][3] = { control_point[0][13].x() ,  control_point[0][13].y() , 0 };
	B_[2][3] = { control_point[0][14].x() ,  control_point[0][14].y() , 0 };
	//B_[3][3] = { width  ,             height , 0 };
	B_[3][3] = { control_point[0][15].x() ,  control_point[0][15].y() , 0 };


	const int vertex_size = 3200;
	static  float vertexColors[vertex_size] = {};
	static  float vertexPositions[vertex_size] = {};
	int gridRes = 20;

	QVector<QVector<QPoint>> bezSurfPoints(gridRes + 1, QVector<QPoint>(gridRes + 1, QPoint(0, 0)));
	for (int i = 0; i <= gridRes; i++) {
		for (int j = 0; j <= gridRes; j++) {

			auto rlt = bezier(i / float(gridRes), j / float(gridRes));
			float x = rlt.x;
			float y = rlt.y;
			// 左移 width/2 下移 height /2
			x = x * 2 - myimage.width();
			y = y * 2 - myimage.height();

			bezSurfPoints[i][j] = QPoint(x, y);

		}
	}

	int index_tex = 0;
	int index_pos = 0;
	for (int i = 0; i < gridRes; i++) {
		for (int j = 0; j < gridRes; j++) {


			vertexPositions[index_pos++] = bezSurfPoints[i][j].x() / float(width);
			vertexPositions[index_pos++] = bezSurfPoints[i][j].y() / float(height);
			vertexColors[index_tex++] = (i) * (width / gridRes / float(width));
			vertexColors[index_tex++] = (j) * (height / gridRes) / float(height);


			vertexPositions[index_pos++] = bezSurfPoints[i + 1][j].x() / float(width);
			vertexPositions[index_pos++] = bezSurfPoints[i + 1][j].y() / float(height);
			vertexColors[index_tex++] = (i + 1) * (width / gridRes / float(width)); ;
			vertexColors[index_tex++] = (j) * (height / gridRes) / float(height);


			vertexPositions[index_pos++] = bezSurfPoints[i + 1][j + 1].x() / float(width);
			vertexPositions[index_pos++] = bezSurfPoints[i + 1][j + 1].y() / float(height);
			vertexColors[index_tex++] = (i + 1) * (width / gridRes / float(width)); ;
			vertexColors[index_tex++] = (j + 1) * (height / gridRes) / float(height);



			vertexPositions[index_pos++] = bezSurfPoints[i][j + 1].x() / float(width);
			vertexPositions[index_pos++] = bezSurfPoints[i][j + 1].y() / float(height);
			vertexColors[index_tex++] = (i) * (width / gridRes / float(width)); ;
			vertexColors[index_tex++] = (j + 1) * (height / gridRes) / float(height); ;


		}
	}

	QOpenGLBuffer vertexPositionBuffer(QOpenGLBuffer::VertexBuffer);
	vertexPositionBuffer.create();
	vertexPositionBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
	vertexPositionBuffer.bind();
	vertexPositionBuffer.allocate(vertexPositions, vertex_size * sizeof(float));

	QOpenGLBuffer vertexColorBuffer(QOpenGLBuffer::VertexBuffer);
	vertexColorBuffer.create();
	vertexColorBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
	vertexColorBuffer.bind();
	vertexColorBuffer.allocate(vertexColors, vertex_size * sizeof(float));

	QOpenGLShaderProgram program;
	program.addShaderFromSourceCode(QOpenGLShader::Vertex,
		"#version 330\r\n"
		"in vec2 position;\n"
		"in vec2 color;\n"
		"out vec2 fragColor;\n"
		"void main() {\n"
		"    fragColor = color;\n"
		"    gl_Position = vec4(position, 0.0, 1.0);\n"
		"}\n"
	);
	program.addShaderFromSourceCode(QOpenGLShader::Fragment,
		"#version 330\r\n"
		"out vec4 renders;;\n"
		"in vec2 fragColor;\n"
		"uniform sampler2D imgTexture;\n"
		"void main() {\n"
		"    renders = texture(imgTexture, fragColor);\n"
		"}\n"
	);
	program.link();
	program.bind();

	QOpenGLVertexArrayObject vao;
	vao.create();
	vao.bind();

	vertexPositionBuffer.bind();
	program.enableAttributeArray("position");
	program.setAttributeBuffer("position", GL_FLOAT, 0, 2);

	vertexColorBuffer.bind();
	program.enableAttributeArray("color");
	program.setAttributeBuffer("color", GL_FLOAT, 0, 2);

	QOpenGLTexture texture(QOpenGLTexture::Target2D);
	program.bind();
	{
		texture.create();
		texture.setData(myimage.mirrored());
		// texture.setMinMagFilters(QOpenGLTexture::LinearMipMapLinear,QOpenGLTexture::LinearMipMapNearest);
		// texture.setWrapMode(QOpenGLTexture::DirectionS,QOpenGLTexture::Repeat);
		// texture.setWrapMode(QOpenGLTexture::DirectionT,QOpenGLTexture::Repeat);
		texture.bind(0);
		program.setUniformValue("imgTexture", 0);
		openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // this is must , 防止小图显示奇怪的花纹
		openGLContext.functions()->glDrawArrays(GL_QUADS, 0, vertex_size / 2);
		//QImage im = fbo.toImage().convertToFormat(QImage::Format_ARGB32);;

		//if (im.save("d://temp//test.png")) {
		//	qDebug("Image saved!");
		//}


	}

	program.disableAttributeArray("position");
	program.disableAttributeArray("color");
	program.release();
	fbo.release();
	vertexColorBuffer.release();
	vertexPositionBuffer.release();

	QImage im = fbo.toImage().convertToFormat(QImage::Format_ARGB32);;

	image = im;
#endif
	return true;

}





int main(int argc, char *argv[])
{
    QGuiApplication a(argc, argv);
    //test2();
    trigle5();
    //   Set OpenGL version to use
        QSurfaceFormat surfaceFormat;
        surfaceFormat.setMajorVersion(4);
        surfaceFormat.setMinorVersion(3);

        QOpenGLContext openGLContext;
        openGLContext.setFormat(surfaceFormat);
        openGLContext.create();
        if(!openGLContext.isValid()) qDebug("Unable to create context");

        QOffscreenSurface surface;
        surface.setFormat(surfaceFormat);
        surface.create();
        if(!surface.isValid()) qDebug("Unable to create the Offscreen surface");

        openGLContext.makeCurrent(&surface);

    //   Viewport size
        QSize vpSize = QSize(300, 300);

        QOpenGLFramebufferObjectFormat fboFormat;
        fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
        QOpenGLFramebufferObject fbo(vpSize, fboFormat);
        openGLContext.functions()->glViewport(0,0,vpSize.width(), vpSize.height());
        fbo.bind();

    //    ========GEOMEETRY SETUP========

        static const float vertexPositions[] = {
            -1.0f, -1.0f,
            -0.0f,  1.0f,
             1.0f, -1.0f,
        };

        static const float vertexColors[] = {
           1.0f, 0.0f, 0.0f,
           0.0f, 1.0f, 0.0f,
           0.0f, 0.0f, 1.0f
        };

        QOpenGLBuffer vertexPositionBuffer(QOpenGLBuffer::VertexBuffer);
        vertexPositionBuffer.create();
        vertexPositionBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
        vertexPositionBuffer.bind();
        vertexPositionBuffer.allocate(vertexPositions, 6 * sizeof(float));

        QOpenGLBuffer vertexColorBuffer(QOpenGLBuffer::VertexBuffer);
        vertexColorBuffer.create();
        vertexColorBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
        vertexColorBuffer.bind();
        vertexColorBuffer.allocate(vertexColors, 9 * sizeof(float));

        QOpenGLShaderProgram program;
        program.addShaderFromSourceCode(QOpenGLShader::Vertex,
                                       "#version 330\r\n"
                                       "in vec2 position;\n"
                                       "in vec3 color;\n"
                                       "out vec3 fragColor;\n"
                                       "void main() {\n"
                                       "    fragColor = color;\n"
                                       "    gl_Position = vec4(position, 0.0, 1.0);\n"
                                       "}\n"
                                       );
        program.addShaderFromSourceCode(QOpenGLShader::Fragment,
                                       "#version 330\r\n"
                                       "in vec3 fragColor;\n"
                                       "out vec4 color;\n"
                                       "void main() {\n"
                                       "    color = vec4(fragColor, 1.0);\n"
                                       "}\n"
                                       );
        program.link();
        program.bind();

        QOpenGLVertexArrayObject vao;
        vao.create();
        vao.bind();

        vertexPositionBuffer.bind();
        program.enableAttributeArray("position");
        program.setAttributeBuffer("position", GL_FLOAT, 0, 2);

        vertexColorBuffer.bind();
        program.enableAttributeArray("color");
        program.setAttributeBuffer("color", GL_FLOAT, 0, 3);

    //    ==============DRAWING TO THE FBO============

        openGLContext.functions()->glClearColor(0.3f, 0.0f, 0.7f, 1.0f);
        openGLContext.functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        openGLContext.functions()->glDrawArrays(GL_TRIANGLES, 0, 3);

    //   =============CLEANUP================== maybe not necessary
        program.disableAttributeArray("position");
        program.disableAttributeArray("color");
        program.release();
        fbo.release();

    //    ========SAVE IMAGE===========

        QImage im = fbo.toImage();

        if (im.save("d://temp//asd.png")){
           qDebug("Image saved!!");
        }

}


